| 1 |
.tableberg-search { |
| 2 |
display: flex; |
| 3 |
align-items: center; |
| 4 |
gap: 12px; |
| 5 |
padding: 0 0 12px 0; |
| 6 |
|
| 7 |
// The field's frame lives on the wrapper, not the input, and the icon is |
| 8 |
// a flex sibling rather than an overlay. Themes style bare inputs |
| 9 |
// (`input[type="text"]`) which outranks a single class, so an overlaid |
| 10 |
// icon ended up sitting on top of the placeholder whenever a theme |
| 11 |
// replaced our padding. Laid out in flow, they cannot collide. |
| 12 |
&__input-wrapper { |
| 13 |
display: flex; |
| 14 |
align-items: center; |
| 15 |
gap: 8px; |
| 16 |
flex: 0 0 auto; |
| 17 |
max-width: 300px; |
| 18 |
padding: 8px 10px; |
| 19 |
border: 1px solid var(--wp--preset--color--contrast, #1e1e1e); |
| 20 |
border-radius: 4px; |
| 21 |
|
| 22 |
&:focus-within { |
| 23 |
border-color: var(--wp-admin-theme-color, #007cba); |
| 24 |
box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #007cba); |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
&__icon { |
| 29 |
display: flex; |
| 30 |
flex: 0 0 auto; |
| 31 |
color: #757575; |
| 32 |
pointer-events: none; |
| 33 |
} |
| 34 |
|
| 35 |
// Scoped one level deeper so a theme's `input[type="text"]` rules do not |
| 36 |
// win over the reset. |
| 37 |
.tableberg-search__input { |
| 38 |
flex: 1 1 auto; |
| 39 |
min-width: 0; |
| 40 |
margin: 0; |
| 41 |
padding: 0; |
| 42 |
border: 0; |
| 43 |
border-radius: 0; |
| 44 |
background-color: transparent; |
| 45 |
color: inherit; |
| 46 |
font-size: 0.875em; |
| 47 |
font-family: inherit; |
| 48 |
line-height: 1.4; |
| 49 |
|
| 50 |
&::placeholder { |
| 51 |
color: #757575; |
| 52 |
} |
| 53 |
|
| 54 |
&:focus { |
| 55 |
border: 0; |
| 56 |
outline: none; |
| 57 |
box-shadow: none; |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
.tableberg-search__clear { |
| 62 |
flex: 0 0 auto; |
| 63 |
display: flex; |
| 64 |
align-items: center; |
| 65 |
justify-content: center; |
| 66 |
margin: 0; |
| 67 |
padding: 0; |
| 68 |
background: transparent; |
| 69 |
border: none; |
| 70 |
border-radius: 2px; |
| 71 |
cursor: pointer; |
| 72 |
color: #757575; |
| 73 |
|
| 74 |
&:hover { |
| 75 |
color: var(--wp--preset--color--contrast, #1e1e1e); |
| 76 |
background-color: rgba(0, 0, 0, 0.05); |
| 77 |
} |
| 78 |
} |
| 79 |
|
| 80 |
&__results { |
| 81 |
font-size: 0.875em; |
| 82 |
color: #757575; |
| 83 |
white-space: nowrap; |
| 84 |
} |
| 85 |
} |
| 86 |
|
| 87 |
.wp-block-tableberg tbody tr.tableberg-search-row--hidden { |
| 88 |
display: none; |
| 89 |
} |
| 90 |
|
| 91 |
.wp-block-tableberg mark.tableberg-search-highlight { |
| 92 |
background-color: var(--tableberg-search-highlight-color, #fff3a3); |
| 93 |
border-radius: 2px; |
| 94 |
padding: 0; |
| 95 |
} |
| 96 |
|