|
10 | 10 | * governing permissions and limitations under the License.
|
11 | 11 | */
|
12 | 12 |
|
13 |
| -@import url("./spectrum-clear-button.css"); |
14 |
| -@import url("./clear-button-overrides.css"); |
| 13 | +:host { |
| 14 | + --spectrum-clear-button-background-color: var(--system-clear-button-background-color); |
| 15 | + --spectrum-clear-button-background-color-hover: var(--system-clear-button-background-color-hover); |
| 16 | + --spectrum-clear-button-background-color-down: var(--system-clear-button-background-color-down); |
| 17 | + --spectrum-clear-button-background-color-key-focus: var(--system-clear-button-background-color-key-focus); |
| 18 | +} |
| 19 | + |
| 20 | +:host([static-color="white"]) { |
| 21 | + --spectrum-clear-button-background-color-hover: var(--system-clear-button-static-white-background-color-hover); |
| 22 | + --spectrum-clear-button-background-color-down: var(--system-clear-button-static-white-background-color-down); |
| 23 | + --spectrum-clear-button-background-color-key-focus: var(--system-clear-button-static-white-background-color-key-focus); |
| 24 | +} |
15 | 25 |
|
16 | 26 | :host {
|
| 27 | + --spectrum-clear-button-height: var(--spectrum-component-height-100); |
| 28 | + --spectrum-clear-button-width: var(--spectrum-component-height-100); |
| 29 | + --spectrum-clear-button-padding: var(--spectrum-in-field-button-edge-to-fill); |
| 30 | + --spectrum-clear-button-icon-color: var(--spectrum-neutral-content-color-default); |
| 31 | + --spectrum-clear-button-icon-color-hover: var(--spectrum-neutral-content-color-hover); |
| 32 | + --spectrum-clear-button-icon-color-down: var(--spectrum-neutral-content-color-down); |
| 33 | + --spectrum-clear-button-icon-color-key-focus: var(--spectrum-neutral-content-color-key-focus); |
| 34 | + |
17 | 35 | box-sizing: border-box;
|
| 36 | + block-size: var(--mod-clear-button-height, var(--spectrum-clear-button-height)); |
| 37 | + inline-size: var(--mod-clear-button-width, var(--spectrum-clear-button-width)); |
| 38 | + background-color: var(--mod-clear-button-background-color, transparent); |
| 39 | + padding: var(--mod-clear-button-padding, var(--spectrum-clear-button-padding)); |
| 40 | + color: var(--mod-clear-button-icon-color, var(--spectrum-clear-button-icon-color)); |
| 41 | + border: none; |
| 42 | + border-radius: 100%; |
| 43 | + margin: 0; |
| 44 | +} |
| 45 | + |
| 46 | +:host([size="s"]) { |
| 47 | + --spectrum-clear-button-height: var(--spectrum-component-height-75); |
| 48 | + --spectrum-clear-button-width: var(--spectrum-component-height-75); |
| 49 | +} |
| 50 | + |
| 51 | +:host([size="l"]) { |
| 52 | + --spectrum-clear-button-height: var(--spectrum-component-height-200); |
| 53 | + --spectrum-clear-button-width: var(--spectrum-component-height-200); |
| 54 | +} |
| 55 | + |
| 56 | +:host([size="xl"]) { |
| 57 | + --spectrum-clear-button-height: var(--spectrum-component-height-300); |
| 58 | + --spectrum-clear-button-width: var(--spectrum-component-height-300); |
| 59 | +} |
| 60 | + |
| 61 | +:host([quiet]) { |
| 62 | + --mod-clear-button-background-color: transparent; |
| 63 | + --mod-clear-button-background-color-hover: transparent; |
| 64 | + --mod-clear-button-background-color-down: transparent; |
| 65 | + --mod-clear-button-background-color-key-focus: transparent; |
| 66 | +} |
| 67 | + |
| 68 | +:host([static-color="white"]) { |
| 69 | + --mod-clear-button-icon-color: var(--spectrum-white); |
| 70 | + --mod-clear-button-icon-color-hover: var(--spectrum-white); |
| 71 | + --mod-clear-button-icon-color-down: var(--spectrum-white); |
| 72 | + --mod-clear-button-icon-color-key-focus: var(--spectrum-white); |
| 73 | + --mod-clear-button-icon-color-disabled: var(--spectrum-disabled-static-white-content-color); |
| 74 | + --mod-clear-button-background-color: transparent; |
| 75 | +} |
| 76 | + |
| 77 | +:host(:disabled), |
| 78 | +:host([disabled]) { |
| 79 | + --mod-clear-button-icon-color: var(--mod-clear-button-icon-color-disabled, var(--spectrum-disabled-content-color)); |
| 80 | + --mod-clear-button-icon-color-hover: var(--spectrum-disabled-content-color); |
| 81 | + --mod-clear-button-icon-color-down: var(--spectrum-disabled-content-color); |
| 82 | + --mod-clear-button-background-color: var(--mod-clear-button-background-color-disabled, transparent); |
| 83 | +} |
| 84 | + |
| 85 | +:host(:not(:disabled)), |
| 86 | +:host(:not([disabled])) { |
| 87 | + cursor: pointer; |
| 88 | +} |
| 89 | + |
| 90 | +.icon { |
| 91 | + margin-block: 0; |
| 92 | + margin-inline: auto; |
| 93 | +} |
| 94 | + |
| 95 | +@media (hover: hover) { |
| 96 | + :host(:hover:not(:disabled)), |
| 97 | + :host(:hover:not([disabled])) { |
| 98 | + color: var(--highcontrast-clear-button-icon-color-hover, var(--mod-clear-button-icon-color-hover, var(--spectrum-clear-button-icon-color-hover))); |
| 99 | + } |
| 100 | + |
| 101 | + :host(:hover:not(:disabled)) .fill, |
| 102 | + :host(:hover:not([disabled])) .fill { |
| 103 | + background-color: var(--mod-clear-button-background-color-hover, var(--spectrum-clear-button-background-color-hover)); |
| 104 | + } |
| 105 | +} |
| 106 | + |
| 107 | +:host(:is(:active, [active]):not(:disabled)), |
| 108 | +:host(:is(:active, [active]):not([disabled])) { |
| 109 | + color: var(--mod-clear-button-icon-color-down, var(--spectrum-clear-button-icon-color-down)); |
| 110 | +} |
| 111 | + |
| 112 | +:host(:is(:active, [active]):not(:disabled)), |
| 113 | +:host(:is(:active, [active]):not([disabled])) .fill { |
| 114 | + background-color: var(--mod-clear-button-background-color-down, var(--spectrum-clear-button-background-color-down)); |
| 115 | +} |
| 116 | + |
| 117 | +:host(:not(:disabled):focus-visible), |
| 118 | +:host(:not([disabled]):focus-visible), |
| 119 | +:host(:not(:disabled):focus-within), |
| 120 | +:host(:not([disabled]):focus-within) { |
| 121 | + color: var(--mod-clear-button-icon-color-key-focus, var(--spectrum-clear-button-icon-color-key-focus)); |
| 122 | +} |
| 123 | + |
| 124 | +:host(:not(:disabled):focus-visible) .fill, |
| 125 | +:host(:not([disabled]):focus-visible) .fill, |
| 126 | +:host(:not(:disabled):focus-within) .fill, |
| 127 | +:host(:not([disabled]):focus-within) .fill { |
| 128 | + background-color: var(--mod-clear-button-background-color-key-focus, var(--spectrum-clear-button-background-color-key-focus)); |
| 129 | +} |
| 130 | + |
| 131 | +.icon { |
| 132 | + color: inherit; |
| 133 | +} |
| 134 | + |
| 135 | +.fill { |
| 136 | + background-color: var(--mod-clear-button-background-color, var(--spectrum-clear-button-background-color)); |
| 137 | + inline-size: 100%; |
| 138 | + block-size: 100%; |
| 139 | + border-radius: 100%; |
| 140 | + justify-content: center; |
| 141 | + align-items: center; |
| 142 | + display: flex; |
| 143 | +} |
| 144 | + |
| 145 | +:host([variant="overBackground"]:focus-visible), |
| 146 | +:host([static-color="white"]:focus-visible) { |
| 147 | + outline: none; |
| 148 | +} |
| 149 | + |
| 150 | +@media (forced-colors: active) { |
| 151 | + :host(:not(:disabled)), |
| 152 | + :host(:not([disabled])) { |
| 153 | + --highcontrast-clear-button-icon-color-hover: Highlight; |
| 154 | + } |
18 | 155 | }
|
0 commit comments