-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.scss
146 lines (143 loc) · 2.56 KB
/
index.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
$name: 'tag-picker';
%tag {
align-items: center;
border: 1px solid;
border-color: inherit;
display: flex;
gap: 0.25em;
justify-content: center;
overflow: hidden;
padding: 0 0.25em;
position: relative;
text-decoration: none;
}
.#{$name} {
&,
& * {
box-sizing: border-box;
color: inherit;
font: inherit;
outline: 0;
}
}
.#{$name} {
border: 1px solid;
cursor: text;
display: inline-flex;
flex-wrap: wrap;
position: relative;
vertical-align: middle;
&__self {
left: -9999px;
position: fixed;
top: -9999px;
&:disabled {
+ .#{$name} {
color: rgba(128, 128, 128, 1);
}
+ .#{$name} {
&,
& * {
cursor: not-allowed;
}
}
}
&:read-only {
+ .#{$name} {
.#{$name}__x {
cursor: not-allowed;
}
}
}
}
&__tag {
@extend %tag;
cursor: pointer;
&:focus {
outline: 2px solid;
outline: {
offset: -2px;
}
}
&--selected {
background: rgba(0, 0, 255, 0.5);
}
// Keep selection (so that context menu can show the “Copy” command), but hide it visually
::selection {
background-color: transparent;
color: inherit;
}
+ .#{$name}__text {
span {
+ span {
// Hide the placeholder if we have at least one tag
display: none;
}
}
}
}
&__tags {
border-color: inherit;
display: flex;
flex-wrap: wrap;
flex: 1;
gap: 1px;
padding: 1px;
}
&__text {
@extend %tag;
border-color: transparent;
flex: 1;
span {
flex: 1;
position: relative;
z-index: 1;
// Ensure height even when tag(s) is empty
&::after {
content: '\200c';
}
* {
display: inline; // Remove (hide) line-break in tag editor
}
br {
display: none;
}
+ span {
align-items: center;
bottom: 0;
display: flex;
left: 0;
opacity: 0.5;
padding: inherit;
position: absolute;
right: 0;
top: 0;
white-space: nowrap;
z-index: 0;
}
}
}
&__x {
height: 1em;
line-height: 0;
margin-right: -0.125em;
position: relative;
width: 1em;
&::after,
&::before {
border: 1px solid;
bottom: 0;
content: "";
left: 50%;
margin-left: -1px;
position: absolute;
top: 0;
}
&::after {
transform: rotate(45deg);
}
&::before {
transform: rotate(135deg);
}
}
}