/
calcite-chip.scss
192 lines (170 loc) · 4.21 KB
/
calcite-chip.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// scale
// todo update when new spacing modifiers are introduced to calcite-base
:host([scale="s"]) {
@apply h-6 text-n2;
--calcite-chip-spacing-unit-l: theme("spacing.2");
--calcite-chip-spacing-unit-s: theme("spacing.1");
.chip-image-container {
@apply h-5 w-5;
}
}
:host([scale="m"]) {
@apply h-8 text-n1;
--calcite-chip-spacing-unit-l: theme("spacing.3");
--calcite-chip-spacing-unit-s: 6px;
.chip-image-container {
@apply h-6 w-6;
padding-inline-start: theme("padding.1");
}
}
:host([scale="l"]) {
@apply h-11 text-0;
--calcite-chip-spacing-unit-l: theme("spacing.4");
--calcite-chip-spacing-unit-s: theme("spacing.2");
.chip-image-container {
@apply h-8 w-8 pl-1;
}
}
:host {
@apply inline-flex
items-center
border
border-solid
border-color-1
text-color-1
font-medium
cursor-default
rounded-full
box-border;
}
.container {
@apply inline-flex items-center h-full max-w-full;
}
.title {
@apply truncate;
}
:host span {
padding: 0 var(--calcite-chip-spacing-unit-l);
}
:host([dismissible]) span {
padding-inline: var(--calcite-chip-spacing-unit-l) var(--calcite-chip-spacing-unit-s);
}
:host([icon]:not([dismissible])) span {
padding: 0 var(--calcite-chip-spacing-unit-l);
}
:host button {
@apply m-0
bg-transparent
focus-base
inline-flex
min-h-full
max-h-full
self-stretch
items-center
border-none
cursor-pointer
transition-default
text-color-1;
-webkit-appearance: none;
border-start-start-radius: 0;
border-start-end-radius: 50px;
border-end-end-radius: 50px;
border-end-start-radius: 0;
padding: 0 var(--calcite-chip-spacing-unit-s);
color: inherit;
// close button focus styles
--calcite-chip-transparent-hover: var(--calcite-button-transparent-hover);
--calcite-chip-transparent-press: var(--calcite-button-transparent-press);
&:hover {
background-color: var(--calcite-chip-transparent-hover);
}
&:focus {
background-color: var(--calcite-chip-transparent-hover);
@apply focus-inset;
}
&:active {
background-color: var(--calcite-chip-transparent-press);
}
}
//slotted image
.chip-image-container {
@apply rounded-half overflow-hidden inline-flex;
}
:host slot[name="image"]::slotted(*) {
@apply flex h-full w-full rounded-half overflow-hidden;
}
//icon
.calcite-chip--icon {
@apply inline-flex
relative
my-0
duration-150
ease-in-out;
margin-inline-end: 0;
margin-inline-start: var(--calcite-chip-spacing-unit-l);
border-start-start-radius: 0;
border-start-end-radius: 50px;
border-end-end-radius: 50px;
border-end-start-radius: 0;
}
// solid
:host([color="blue"][appearance="solid"]) {
border-color: transparent;
background-color: var(--calcite-ui-info);
color: var(--calcite-ui-text-inverse);
}
:host([color="red"][appearance="solid"]) {
border-color: transparent;
background-color: var(--calcite-ui-danger);
color: var(--calcite-ui-text-inverse);
}
:host([color="yellow"][appearance="solid"]) {
border-color: transparent;
background-color: var(--calcite-ui-warning);
color: $blk-220;
}
:host([color="green"][appearance="solid"]) {
border-color: transparent;
background-color: var(--calcite-ui-success);
color: $blk-220;
}
:host([color="grey"][appearance="solid"]) {
border-color: transparent;
background-color: var(--calcite-ui-foreground-2);
color: var(--calcite-ui-text-1);
button,
calcite-icon {
color: var(--calcite-ui-text-3);
}
}
// clear
:host([color="blue"][appearance="clear"]) {
border-color: var(--calcite-ui-info);
.calcite-chip--icon {
color: var(--calcite-ui-info);
}
}
:host([color="red"][appearance="clear"]) {
border-color: var(--calcite-ui-danger);
.calcite-chip--icon {
color: var(--calcite-ui-danger);
}
}
:host([color="yellow"][appearance="clear"]) {
border-color: var(--calcite-ui-warning);
.calcite-chip--icon {
color: var(--calcite-ui-warning);
}
}
:host([color="green"][appearance="clear"]) {
border-color: var(--calcite-ui-success);
.calcite-chip--icon {
color: var(--calcite-ui-success);
}
}
:host([color="grey"][appearance="clear"]) {
border-color: var(--calcite-ui-border-1);
.calcite-chip--icon {
color: var(--calcite-ui-text-3);
}
}