|
| 1 | +@import "../styles/common"; |
| 2 | + |
1 | 3 | @mixin base {
|
2 | 4 | display: inline-flex;
|
3 | 5 | align-items: center;
|
4 | 6 | justify-content: center;
|
5 |
| - border-radius: var(--ezui-shape-border-radius-base); |
| 7 | + border-radius: design-token("shape.border_radius.base"); |
6 | 8 | cursor: pointer;
|
7 | 9 |
|
8 | 10 | &:focus {
|
9 |
| - box-shadow: var(--ezui-shadow-button); |
| 11 | + box-shadow: theme-token("shadow.button"); |
10 | 12 | outline: none;
|
11 | 13 | }
|
12 | 14 |
|
|
17 | 19 |
|
18 | 20 | @mixin variantFilled {
|
19 | 21 | border: 0;
|
20 |
| - background-color: var(--ezui-c-button-resting-color); |
21 |
| - color: var(--ezui-c-button-filled-font-color); |
| 22 | + background-color: component-token("button", "resting.color"); |
| 23 | + color: component-token("button", "filled.font.color"); |
22 | 24 |
|
23 | 25 | &:focus {
|
24 |
| - background-color: var(--ezui-c-button-hover-focus-color); |
| 26 | + background-color: component-token("button", "hover.focus.color"); |
25 | 27 | }
|
26 | 28 |
|
27 | 29 | &:disabled {
|
28 |
| - color: var(--ezui-color-white); |
29 |
| - background-color: var(--ezui-color-gray-200); |
| 30 | + color: theme-token("color.text.inverse"); |
| 31 | + background-color: theme-token("color.background.disabled"); |
30 | 32 | }
|
31 | 33 |
|
32 | 34 | &:link {
|
33 | 35 | text-decoration: none;
|
34 | 36 | }
|
35 | 37 |
|
36 | 38 | &:not(:disabled):active {
|
37 |
| - color: var(--ezui-c-button-filled-active-font-color); |
38 |
| - background-color: var(--ezui-c-button-active-color); |
| 39 | + color: component-token("button", "filled.active.font.color"); |
| 40 | + background-color: component-token("button", "active.color"); |
39 | 41 | &:focus {
|
40 | 42 | box-shadow: none;
|
41 | 43 | }
|
42 | 44 | }
|
43 | 45 |
|
44 | 46 | &:hover:not(:disabled):not(:active) {
|
45 |
| - background-color: var(--ezui-c-button-hover-focus-color); |
| 47 | + background-color: component-token("button", "hover.focus.color"); |
46 | 48 | }
|
47 | 49 | }
|
48 | 50 |
|
49 | 51 | @mixin variantOutlined {
|
50 | 52 | background-color: transparent;
|
51 |
| - border: var(--ezui-shape-border-width-1) solid |
52 |
| - var(--ezui-c-button-resting-color); |
53 |
| - color: var(--ezui-c-button-resting-color); |
| 53 | + border: design-token("shape.border_width.1") solid |
| 54 | + component-token("button", "resting.color"); |
| 55 | + color: component-token("button", "resting.color"); |
54 | 56 |
|
55 | 57 | &:focus {
|
56 |
| - border: var(--ezui-shape-border-width-1) solid |
57 |
| - var(--ezui-c-button-hover-focus-color); |
58 |
| - color: var(--ezui-c-button-hover-focus-color); |
| 58 | + border: design-token("shape.border_width.1") solid |
| 59 | + component-token("button", "hover.focus.color"); |
| 60 | + color: component-token("button", "hover.focus.color"); |
59 | 61 | }
|
60 | 62 |
|
61 | 63 | &:disabled {
|
62 |
| - color: var(--ezui-color-gray-300); |
63 |
| - border: var(--ezui-shape-border-width-1) solid var(--ezui-color-gray-300); |
| 64 | + color: theme-token("color.text.disabled"); |
| 65 | + border: design-token("shape.border_width.1") solid |
| 66 | + theme-token("color.border.disabled"); |
64 | 67 | }
|
65 | 68 |
|
66 | 69 | &:link {
|
67 | 70 | text-decoration: none;
|
68 | 71 | }
|
69 | 72 |
|
70 | 73 | &:active:not(:disabled) {
|
71 |
| - color: var(--ezui-c-button-active-color); |
72 |
| - border: var(--ezui-shape-border-width-1) solid |
73 |
| - var(--ezui-c-button-active-color); |
| 74 | + color: component-token("button", "active.color"); |
| 75 | + border: design-token("shape.border_width.1") solid |
| 76 | + component-token("button", "active.color"); |
74 | 77 | &:focus {
|
75 | 78 | box-shadow: none;
|
76 | 79 | }
|
77 | 80 | }
|
78 | 81 |
|
79 | 82 | &:hover:not(:disabled):not(:active) {
|
80 |
| - border: var(--ezui-shape-border-width-1) solid |
81 |
| - var(--ezui-c-button-hover-focus-color); |
82 |
| - color: var(--ezui-c-button-hover-focus-color); |
| 83 | + border: design-token("shape.border_width.1") solid |
| 84 | + component-token("button", "hover.focus.color"); |
| 85 | + color: component-token("button", "hover.focus.color"); |
83 | 86 | }
|
84 | 87 | }
|
85 | 88 |
|
86 | 89 | @mixin variantLink {
|
87 |
| - color: var(--ezui-c-button-resting-color); |
| 90 | + color: component-token("button", "resting.color"); |
88 | 91 | background-color: transparent;
|
89 |
| - border: var(--ezui-shape-border-width-1) solid transparent; |
| 92 | + border: design-token("shape.border_width.1") solid transparent; |
90 | 93 | text-decoration: underline;
|
91 | 94 |
|
92 | 95 | &:focus {
|
93 |
| - border: var(--ezui-shape-border-width-1) solid |
94 |
| - var(--ezui-c-button-hover-focus-color); |
| 96 | + border: design-token("shape.border_width.1") solid |
| 97 | + component-token("button", "hover.focus.color"); |
95 | 98 | }
|
96 | 99 |
|
97 | 100 | &:disabled {
|
98 |
| - color: var(--ezui-color-gray-300); |
| 101 | + color: theme-token("color.text.disabled"); |
99 | 102 | }
|
100 | 103 |
|
101 | 104 | &:active:not(:disabled) {
|
102 |
| - color: var(--ezui-c-button-active-color); |
| 105 | + color: component-token("button", "active.color"); |
103 | 106 | }
|
104 | 107 |
|
105 | 108 | &:hover:not(:disabled):not(:active) {
|
106 |
| - color: var(--ezui-c-button-hover-focus-color); |
| 109 | + color: component-token("button", "hover.focus.color"); |
107 | 110 | }
|
108 | 111 | }
|
109 | 112 |
|
| 113 | +// prettier-ignore |
110 | 114 | @mixin colorPrimary {
|
111 |
| - --ezui-c-button-filled-font-color: var(--ezui-color-white); |
112 |
| - --ezui-c-button-filled-active-font-color: var(--ezui-color-white); |
113 |
| - --ezui-c-button-resting-color: var(--ezui-color-blue-500); |
114 |
| - --ezui-c-button-hover-focus-color: var(--ezui-color-blue-600); |
115 |
| - --ezui-c-button-active-color: var(--ezui-color-blue-700); |
| 115 | + @include component-token("button", "filled.font.color", theme-token("color.text.inverse")); |
| 116 | + @include component-token("button", "filled.active.font.color", theme-token("color.text.inverse")); |
| 117 | + @include component-token("button", "resting.color", theme-token("color.background.primary")); |
| 118 | + @include component-token("button", "hover.focus.color", theme-token("color.background.primary.hovered")); |
| 119 | + @include component-token("button", "active.color", theme-token("color.background.primary.pressed")); |
116 | 120 | }
|
117 | 121 |
|
| 122 | +// prettier-ignore |
118 | 123 | @mixin colorSecondary {
|
119 |
| - --ezui-c-button-filled-font-color: var(--ezui-color-white); |
120 |
| - --ezui-c-button-filled-active-font-color: var(--ezui-color-white); |
121 |
| - --ezui-c-button-resting-color: var(--ezui-color-purple-500); |
122 |
| - --ezui-c-button-hover-focus-color: var(--ezui-color-purple-800); |
123 |
| - --ezui-c-button-active-color: var(--ezui-color-purple-700); |
| 124 | + @include component-token("button", "filled.font.color", theme-token("color.text.inverse")); |
| 125 | + @include component-token("button", "filled.active.font.color", theme-token("color.text.inverse")); |
| 126 | + @include component-token("button", "resting.color", theme-token("color.background.secondary")); |
| 127 | + @include component-token("button", "hover.focus.color", theme-token("color.background.secondary.hovered")); |
| 128 | + @include component-token("button", "active.color", theme-token("color.background.secondary.pressed")); |
124 | 129 | }
|
125 | 130 |
|
| 131 | +// prettier-ignore |
126 | 132 | @mixin colorSuccess {
|
127 |
| - --ezui-c-button-filled-font-color: var(--ezui-color-blue-800); |
128 |
| - --ezui-c-button-filled-active-font-color: var(--ezui-color-white); |
129 |
| - --ezui-c-button-resting-color: var(--ezui-color-green-500); |
130 |
| - --ezui-c-button-hover-focus-color: var(--ezui-color-green-600); |
131 |
| - --ezui-c-button-active-color: var(--ezui-color-green-700); |
| 133 | + @include component-token("button", "filled.font.color", theme-token("color.text.success.inverse")); |
| 134 | + @include component-token("button", "filled.active.font.color", theme-token("color.text.success.inverse.pressed")); |
| 135 | + @include component-token("button", "resting.color", theme-token("color.background.success")); |
| 136 | + @include component-token("button", "hover.focus.color", theme-token("color.background.success.hovered")); |
| 137 | + @include component-token("button", "active.color", theme-token("color.background.success.pressed")); |
132 | 138 | }
|
133 | 139 |
|
| 140 | +// prettier-ignore |
134 | 141 | @mixin colorWarning {
|
135 |
| - --ezui-c-button-filled-font-color: var(--ezui-color-blue-800); |
136 |
| - --ezui-c-button-filled-active-font-color: var(--ezui-color-blue-800); |
137 |
| - --ezui-c-button-resting-color: var(--ezui-color-red-500); |
138 |
| - --ezui-c-button-hover-focus-color: var(--ezui-color-red-600); |
139 |
| - --ezui-c-button-active-color: var(--ezui-color-red-700); |
| 142 | + @include component-token("button", "filled.font.color",theme-token("color.text.danger.inverse")); |
| 143 | + @include component-token("button", "filled.active.font.color",theme-token("color.text.danger.inverse.pressed")); |
| 144 | + @include component-token("button", "resting.color",theme-token("color.background.danger")); |
| 145 | + @include component-token("button", "hover.focus.color",theme-token("color.background.danger.hovered")); |
| 146 | + @include component-token("button", "active.color",theme-token("color.background.danger.pressed")); |
140 | 147 | }
|
141 | 148 |
|
| 149 | +// prettier-ignore |
142 | 150 | @mixin colorNeutral {
|
143 |
| - --ezui-c-button-filled-font-color: var(--ezui-color-white); |
144 |
| - --ezui-c-button-filled-active-font-color: var(--ezui-color-white); |
145 |
| - --ezui-c-button-resting-color: var(--ezui-color-blue-800); |
146 |
| - --ezui-c-button-hover-focus-color: var(--ezui-color-black); |
147 |
| - --ezui-c-button-active-color: var(--ezui-color-blue-700); |
| 151 | + @include component-token("button", "filled.font.color", theme-token("color.text.inverse")); |
| 152 | + @include component-token("button", "filled.active.font.color", theme-token("color.text.inverse")); |
| 153 | + @include component-token("button", "resting.color", theme-token("color.background.neutral")); |
| 154 | + @include component-token("button", "hover.focus.color", theme-token("color.background.neutral.hovered")); |
| 155 | + @include component-token("button", "active.color", theme-token("color.background.neutral.pressed")); |
148 | 156 | }
|
149 | 157 |
|
| 158 | +// prettier-ignore |
150 | 159 | @mixin colorSupport {
|
151 |
| - --ezui-c-button-resting-color: var(--ezui-color-blue-800); |
152 |
| - --ezui-c-button-hover-focus-color: var(--ezui-color-black); |
153 |
| - --ezui-c-button-active-color: var(--ezui-color-gray-700); |
| 160 | + @include component-token("button", "resting.color", theme-token("color.border.support")); |
| 161 | + @include component-token("button", "hover.focus.color", theme-token("color.border.support.hovered")); |
| 162 | + @include component-token("button", "active.color", theme-token("color.border.support.pressed")); |
154 | 163 | }
|
155 | 164 |
|
| 165 | +// prettier-ignore |
156 | 166 | @mixin colorInverse {
|
157 |
| - --ezui-c-button-resting-color: var(--ezui-color-white); |
158 |
| - --ezui-c-button-hover-focus-color: var(--ezui-color-gray-100); |
159 |
| - --ezui-c-button-active-color: var(--ezui-color-gray-200); |
| 167 | + @include component-token("button", "resting.color", theme-token("color.border.inverse")); |
| 168 | + @include component-token("button", "hover.focus.color", theme-token("color.border.inverse.hovered")); |
| 169 | + @include component-token("button", "active.color", theme-token("color.border.inverse.pressed")); |
160 | 170 | }
|
0 commit comments