@nuvoui/core 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/dark.css +1 -0
- package/dist/index.css +1 -0
- package/dist/index.css.map +1 -0
- package/dist/index.html +15 -0
- package/dist/light.css +1 -0
- package/dist/main.css +1 -0
- package/dist/main.js +1 -0
- package/package.json +43 -0
- package/src/js/main.js +1 -0
- package/src/styles/_global.scss +3 -0
- package/src/styles/base/_base.scss +75 -0
- package/src/styles/base/_reset.scss +92 -0
- package/src/styles/components/_alert.scss +0 -0
- package/src/styles/components/_avatar.scss +0 -0
- package/src/styles/components/_badge.scss +0 -0
- package/src/styles/components/_breadcrumb.scss +0 -0
- package/src/styles/components/_button.scss +247 -0
- package/src/styles/components/_calendar.scss +0 -0
- package/src/styles/components/_card.scss +0 -0
- package/src/styles/components/_checkbox.scss +23 -0
- package/src/styles/components/_dropdown.scss +0 -0
- package/src/styles/components/_form.scss +157 -0
- package/src/styles/components/_modal.scss +0 -0
- package/src/styles/components/_navbar.scss +125 -0
- package/src/styles/components/_pagination.scss +0 -0
- package/src/styles/components/_progress.scss +0 -0
- package/src/styles/components/_radio.scss +0 -0
- package/src/styles/components/_sidebar.scss +0 -0
- package/src/styles/components/_table.scss +0 -0
- package/src/styles/components/_tabs.scss +0 -0
- package/src/styles/components/_tooltip.scss +0 -0
- package/src/styles/index.scss +34 -0
- package/src/styles/layouts/_container.scss +49 -0
- package/src/styles/layouts/_flex.scss +138 -0
- package/src/styles/layouts/_grid.scss +147 -0
- package/src/styles/themes/_dark.scss +26 -0
- package/src/styles/themes/_light.scss +23 -0
- package/src/styles/themes/_theme.scss +136 -0
- package/src/styles/utilities/_animations.scss +135 -0
- package/src/styles/utilities/_colors.scss +158 -0
- package/src/styles/utilities/_functions.scss +59 -0
- package/src/styles/utilities/_position.scss +97 -0
- package/src/styles/utilities/_shadows.scss +107 -0
- package/src/styles/utilities/_spacing.scss +109 -0
- package/src/styles/utilities/_tooltips.scss +213 -0
- package/src/styles/utilities/_typography.scss +108 -0
- package/src/styles/utilities/_variables.scss +70 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
// Import variables
|
|
4
|
+
@use '../utilities/variables' as *;
|
|
5
|
+
|
|
6
|
+
// Base typography styles
|
|
7
|
+
html {
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
font-family: var(--font-family-base);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
body {
|
|
13
|
+
font-family: var(--font-family-base);
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
line-height: 1.5;
|
|
16
|
+
color: var(--text-primary);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Headings
|
|
20
|
+
h1, h2, h3, h4, h5, h6 {
|
|
21
|
+
margin-bottom: 0.5em;
|
|
22
|
+
font-family: var(--font-family-heading);
|
|
23
|
+
font-weight: 700;
|
|
24
|
+
line-height: 1.2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
h1 {
|
|
28
|
+
font-size: map.get($font-sizes, '4xl');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
h2 {
|
|
32
|
+
font-size: map.get($font-sizes, '3xl');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h3 {
|
|
36
|
+
font-size: map.get($font-sizes, '2xl');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
h4 {
|
|
40
|
+
font-size: map.get($font-sizes, 'xl');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
h5 {
|
|
44
|
+
font-size: map.get($font-sizes, 'lg');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
h6 {
|
|
48
|
+
font-size: map.get($font-sizes, 'base');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Paragraphs
|
|
52
|
+
p {
|
|
53
|
+
margin-bottom: 1rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Small text
|
|
57
|
+
small {
|
|
58
|
+
font-size: map.get($font-sizes, 'sm');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Links
|
|
62
|
+
a {
|
|
63
|
+
color: var(--link-color);
|
|
64
|
+
transition: color 0.2s ease-in-out;
|
|
65
|
+
|
|
66
|
+
&:hover {
|
|
67
|
+
color: var(--link-hover-color);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Lists
|
|
72
|
+
ul, ol {
|
|
73
|
+
margin-bottom: 1rem;
|
|
74
|
+
padding-left: 2rem;
|
|
75
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Modern CSS Reset
|
|
2
|
+
|
|
3
|
+
// Box sizing rules
|
|
4
|
+
*, *::before, *::after {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Remove default margin
|
|
11
|
+
body,
|
|
12
|
+
h1,
|
|
13
|
+
h2,
|
|
14
|
+
h3,
|
|
15
|
+
h4,
|
|
16
|
+
h5,
|
|
17
|
+
h6,
|
|
18
|
+
p,
|
|
19
|
+
figure,
|
|
20
|
+
blockquote,
|
|
21
|
+
dl,
|
|
22
|
+
dd {
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Set core body defaults
|
|
27
|
+
body {
|
|
28
|
+
min-height: 100vh;
|
|
29
|
+
text-rendering: optimizeSpeed;
|
|
30
|
+
line-height: 1.5;
|
|
31
|
+
-webkit-font-smoothing: antialiased;
|
|
32
|
+
-moz-osx-font-smoothing: grayscale;
|
|
33
|
+
font-family: 'Courier New', Courier, monospace;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Make images easier to work with
|
|
37
|
+
img,
|
|
38
|
+
picture,
|
|
39
|
+
video,
|
|
40
|
+
canvas,
|
|
41
|
+
svg {
|
|
42
|
+
display: block;
|
|
43
|
+
max-width: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Inherit fonts for inputs and buttons
|
|
47
|
+
input,
|
|
48
|
+
button,
|
|
49
|
+
textarea,
|
|
50
|
+
select {
|
|
51
|
+
font: inherit;
|
|
52
|
+
transition: all 0.2s ease-in-out;
|
|
53
|
+
&:focus {
|
|
54
|
+
box-shadow: inset 0 0 7px 0px #60b0cd; /* Change this to your preferred color and width */
|
|
55
|
+
outline: 2px solid #40c1bf; /* Change this to your preferred color and width */
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Remove all animations and transitions for people that prefer not to see them
|
|
60
|
+
@media (prefers-reduced-motion: reduce) {
|
|
61
|
+
*,
|
|
62
|
+
*::before,
|
|
63
|
+
*::after {
|
|
64
|
+
animation-duration: 0.01ms !important;
|
|
65
|
+
animation-iteration-count: 1 !important;
|
|
66
|
+
transition-duration: 0.01ms !important;
|
|
67
|
+
scroll-behavior: auto !important;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Remove list styles
|
|
72
|
+
ul[role='list'],
|
|
73
|
+
ol[role='list'] {
|
|
74
|
+
list-style: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Set core root defaults
|
|
78
|
+
html:focus-within {
|
|
79
|
+
scroll-behavior: smooth;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Remove underline from links
|
|
83
|
+
a {
|
|
84
|
+
text-decoration-skip-ink: auto;
|
|
85
|
+
text-decoration: none;
|
|
86
|
+
color: inherit;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Make sure textareas without a rows attribute are not tiny
|
|
90
|
+
textarea:not([rows]) {
|
|
91
|
+
min-height: 10em;
|
|
92
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// _button.scss
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
|
|
4
|
+
@use '../utilities/variables' as *;
|
|
5
|
+
@use '../utilities/typography' as *;
|
|
6
|
+
@use '../themes/theme' as *;
|
|
7
|
+
|
|
8
|
+
// Define text size map
|
|
9
|
+
$text-size-map: (
|
|
10
|
+
'xs': 0.75rem,
|
|
11
|
+
'sm': 0.875rem,
|
|
12
|
+
'md': 1rem,
|
|
13
|
+
'lg': 1.125rem,
|
|
14
|
+
'xl': 1.25rem
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
// Button Base Mixins
|
|
18
|
+
@mixin btn-base {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
gap: 0.5rem;
|
|
23
|
+
padding: 0.5rem 1rem;
|
|
24
|
+
border: 1px solid transparent;
|
|
25
|
+
border-radius: 0.375rem;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
transition: all 0.2s ease-in-out;
|
|
29
|
+
|
|
30
|
+
&:disabled {
|
|
31
|
+
cursor: not-allowed;
|
|
32
|
+
opacity: 0.65;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Loading state
|
|
36
|
+
&.loading {
|
|
37
|
+
position: relative;
|
|
38
|
+
color: transparent !important;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
|
|
41
|
+
&::after {
|
|
42
|
+
content: "";
|
|
43
|
+
position: absolute;
|
|
44
|
+
width: 1rem;
|
|
45
|
+
height: 1rem;
|
|
46
|
+
border: 1px solid;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
border-right-color: transparent;
|
|
49
|
+
animation: spin 0.75s linear infinite;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Button Variants
|
|
55
|
+
@mixin btn-solid($color) {
|
|
56
|
+
background-color: theme-color($color);
|
|
57
|
+
color: white;//var(--text-inverse);
|
|
58
|
+
|
|
59
|
+
&:hover:not(:disabled) {
|
|
60
|
+
background-color: theme-color($color, 'hover');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:active:not(:disabled) {
|
|
64
|
+
background-color: theme-color($color, 'active');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:disabled {
|
|
68
|
+
background-color: theme-color($color, 'disabled');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@mixin btn-outline($color) {
|
|
73
|
+
background-color: transparent;
|
|
74
|
+
border-color: theme-color($color);
|
|
75
|
+
color: theme-color($color);
|
|
76
|
+
|
|
77
|
+
&:hover:not(:disabled) {
|
|
78
|
+
background-color: theme-color($color);
|
|
79
|
+
color: var(--text-inverse);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:active:not(:disabled) {
|
|
83
|
+
background-color: theme-color($color, 'active');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:disabled {
|
|
87
|
+
border-color: theme-color($color, 'disabled');
|
|
88
|
+
color: theme-color($color, 'disabled');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@mixin btn-ghost($color) {
|
|
93
|
+
background-color: transparent;
|
|
94
|
+
color: theme-color($color);
|
|
95
|
+
|
|
96
|
+
&:hover:not(:disabled) {
|
|
97
|
+
background-color: theme-color($color, '10');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&:active:not(:disabled) {
|
|
101
|
+
background-color: theme-color($color, '25');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:disabled {
|
|
105
|
+
color: theme-color($color, 'disabled');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Button Sizes
|
|
110
|
+
@mixin btn-size($size) {
|
|
111
|
+
font-size: map.get($text-size-map, $size);
|
|
112
|
+
|
|
113
|
+
$padding-map: (
|
|
114
|
+
'xs': 0.25rem 0.5rem,
|
|
115
|
+
'sm': 0.375rem 0.75rem,
|
|
116
|
+
'md': 0.5rem 1rem,
|
|
117
|
+
'lg': 0.75rem 1.5rem,
|
|
118
|
+
'xl': 1rem 2rem
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
padding: map.get($padding-map, $size);
|
|
122
|
+
|
|
123
|
+
.btn.icon {
|
|
124
|
+
$icon-sizes: (
|
|
125
|
+
'xs': 0.75rem,
|
|
126
|
+
'sm': 1rem,
|
|
127
|
+
'md': 1.25rem,
|
|
128
|
+
'lg': 1.5rem,
|
|
129
|
+
'xl': 1.75rem
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
width: map.get($icon-sizes, $size);
|
|
133
|
+
height: map.get($icon-sizes, $size);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Button Shapes
|
|
138
|
+
@mixin btn-shape($shape) {
|
|
139
|
+
@if $shape == 'rounded' {
|
|
140
|
+
border-radius: 0.375rem;
|
|
141
|
+
} @else if $shape == 'pill' {
|
|
142
|
+
border-radius: 9999px;
|
|
143
|
+
} @else if $shape == 'square' {
|
|
144
|
+
border-radius: 0;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Base Button Class
|
|
149
|
+
.btn {
|
|
150
|
+
@include btn-base;
|
|
151
|
+
@include btn-size('md');
|
|
152
|
+
@include btn-shape('rounded');
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
// Outline variant
|
|
156
|
+
&.outline {
|
|
157
|
+
@include btn-outline('text-secondary'); // Default outline style
|
|
158
|
+
|
|
159
|
+
// Color variants override
|
|
160
|
+
@each $name, $color in $colors {
|
|
161
|
+
&.#{$name} {
|
|
162
|
+
@include btn-outline($name);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Ghost variant
|
|
168
|
+
&.ghost {
|
|
169
|
+
@include btn-ghost('text-secondary'); // Default ghost style
|
|
170
|
+
|
|
171
|
+
// Color variants override
|
|
172
|
+
@each $name, $color in $colors {
|
|
173
|
+
&.#{$name} {
|
|
174
|
+
@include btn-ghost($name);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Color variants for solid buttons
|
|
180
|
+
@each $name, $color in $colors {
|
|
181
|
+
&.#{$name} {
|
|
182
|
+
@include btn-solid($name);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
// Sizes
|
|
189
|
+
.btn.xs { @include btn-size('xs'); }
|
|
190
|
+
.btn.sm { @include btn-size('sm'); }
|
|
191
|
+
.btn.md { @include btn-size('md'); }
|
|
192
|
+
.btn.lg { @include btn-size('lg'); }
|
|
193
|
+
.btn.xl { @include btn-size('xl'); }
|
|
194
|
+
|
|
195
|
+
// Shapes
|
|
196
|
+
.btn.rounded { @include btn-shape('rounded'); }
|
|
197
|
+
.btn.pill { @include btn-shape('pill'); }
|
|
198
|
+
.btn.square { @include btn-shape('square'); }
|
|
199
|
+
|
|
200
|
+
// Icon Only Buttons
|
|
201
|
+
.btn.icon {
|
|
202
|
+
padding: 0.5rem;
|
|
203
|
+
|
|
204
|
+
&.btn-xs { padding: 0.25rem; }
|
|
205
|
+
&.btn-sm { padding: 0.375rem; }
|
|
206
|
+
&.btn-lg { padding: 0.75rem; }
|
|
207
|
+
&.btn-xl { padding: 1rem; }
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Loading Animation
|
|
211
|
+
@keyframes spin {
|
|
212
|
+
to { transform: rotate(360deg); }
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
<!-- Basic buttons -->
|
|
219
|
+
<button class="btn primary">Primary</button>
|
|
220
|
+
<button class="btn outline secondary">Secondary</button>
|
|
221
|
+
<button class="btn ghost info">Info</button>
|
|
222
|
+
|
|
223
|
+
<!-- Sizes -->
|
|
224
|
+
<button class="btn primary xs">Extra Small</button>
|
|
225
|
+
<button class="btn primary xl">Extra Large</button>
|
|
226
|
+
|
|
227
|
+
<!-- Shapes -->
|
|
228
|
+
<button class="btn primary pill">Pill Button</button>
|
|
229
|
+
|
|
230
|
+
<!-- With Icons -->
|
|
231
|
+
<button class="btn btn-primary">
|
|
232
|
+
<svg class="btn-icon"><!-- icon --></svg>
|
|
233
|
+
With Icon
|
|
234
|
+
</button>
|
|
235
|
+
|
|
236
|
+
<!-- Icon Only -->
|
|
237
|
+
<button class="btn btn-primary btn-icon-only">
|
|
238
|
+
<svg class="btn-icon"><!-- icon --></svg>
|
|
239
|
+
</button>
|
|
240
|
+
|
|
241
|
+
<!-- Loading State -->
|
|
242
|
+
<button class="btn btn-primary loading">Loading</button>
|
|
243
|
+
|
|
244
|
+
<!-- Disabled State -->
|
|
245
|
+
<button class="btn btn-primary" disabled>Disabled</button>
|
|
246
|
+
|
|
247
|
+
*/
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Base checkbox reset
|
|
2
|
+
.checkbox {
|
|
3
|
+
@apply appearance-none cursor-pointer select-none;
|
|
4
|
+
@apply w-4 h-4 border-2 rounded;
|
|
5
|
+
@apply transition-all duration-200;
|
|
6
|
+
@apply focus-visible:outline-2 focus-visible:outline-offset-2;
|
|
7
|
+
|
|
8
|
+
&:checked {
|
|
9
|
+
@apply bg-current border-current;
|
|
10
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&:indeterminate {
|
|
14
|
+
@apply bg-current border-current;
|
|
15
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8z'/%3E%3C/svg%3E");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Size variants
|
|
20
|
+
.checkbox-sm { @apply w-3 h-3; }
|
|
21
|
+
.checkbox-md { @apply w-4 h-4; }
|
|
22
|
+
.checkbox-lg { @apply w-5 h-5; }
|
|
23
|
+
.checkbox-xl { @apply w-6 h-6; }
|
|
File without changes
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// _forms.scss
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use '../utilities/variables' as *;
|
|
4
|
+
@use '../themes/theme' as Theme;
|
|
5
|
+
|
|
6
|
+
// Form Container Mixins
|
|
7
|
+
@mixin form-group {
|
|
8
|
+
position: relative;
|
|
9
|
+
margin-bottom: 1.5rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@mixin form-inline {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 1rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Label Mixins
|
|
19
|
+
@mixin form-label {
|
|
20
|
+
position: absolute;
|
|
21
|
+
left: 1rem;
|
|
22
|
+
top: 50%;
|
|
23
|
+
transform: translateY(-50%);
|
|
24
|
+
transition: all 0.2s ease-in-out;
|
|
25
|
+
color: var(--text-secondary);
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
font-size: 1rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@mixin form-label-float {
|
|
31
|
+
top: 0;
|
|
32
|
+
font-size: 0.875rem;
|
|
33
|
+
transform: translateY(-50%);
|
|
34
|
+
background: var(--bg-primary);
|
|
35
|
+
padding: 0 0.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Input Mixins
|
|
39
|
+
@mixin form-input {
|
|
40
|
+
width: 100%;
|
|
41
|
+
padding: 0.85rem;
|
|
42
|
+
border: 1px solid Theme.theme-color('border-color');
|
|
43
|
+
border-radius: 0.5rem;
|
|
44
|
+
background: Theme.theme-color('input-bg');
|
|
45
|
+
color: var(--text-primary);
|
|
46
|
+
font-size: 1rem;
|
|
47
|
+
transition: all 0.2s ease-in-out;
|
|
48
|
+
|
|
49
|
+
&:focus {
|
|
50
|
+
outline: none;
|
|
51
|
+
border-color: var(--primary);
|
|
52
|
+
box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:not(:placeholder-shown) + label {
|
|
56
|
+
@include form-label-float;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:focus + label {
|
|
60
|
+
@include form-label-float;
|
|
61
|
+
color: var(--primary);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Validation Mixins
|
|
66
|
+
@mixin form-valid {
|
|
67
|
+
border-color: var(--success);
|
|
68
|
+
|
|
69
|
+
& + label {
|
|
70
|
+
color: var(--success);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@mixin form-invalid {
|
|
75
|
+
border-color: var(--danger);
|
|
76
|
+
|
|
77
|
+
& + label {
|
|
78
|
+
color: var(--danger);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Select Mixins
|
|
83
|
+
@mixin form-select {
|
|
84
|
+
@include form-input;
|
|
85
|
+
appearance: none;
|
|
86
|
+
background-image: url("data:image/svg+xml,...");
|
|
87
|
+
background-repeat: no-repeat;
|
|
88
|
+
background-position: right 1rem center;
|
|
89
|
+
padding-right: 2.5rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Checkbox & Radio Mixins
|
|
93
|
+
@mixin form-check {
|
|
94
|
+
position: relative;
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
user-select: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@mixin form-check-input {
|
|
102
|
+
appearance: none;
|
|
103
|
+
width: 1.25rem;
|
|
104
|
+
height: 1.25rem;
|
|
105
|
+
border: 2px solid var(--border-color);
|
|
106
|
+
border-radius: 0.25rem;
|
|
107
|
+
margin-right: 0.5rem;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
|
|
110
|
+
&:checked {
|
|
111
|
+
background-color: var(--primary);
|
|
112
|
+
border-color: var(--primary);
|
|
113
|
+
background-image: url("data:image/svg+xml,...");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Classes
|
|
118
|
+
.form-group { @include form-group; }
|
|
119
|
+
.form-inline { @include form-inline; }
|
|
120
|
+
.form-label { @include form-label; }
|
|
121
|
+
.form-input { @include form-input; }
|
|
122
|
+
.form-select { @include form-select; }
|
|
123
|
+
.form-check { @include form-check; }
|
|
124
|
+
.form-check-input { @include form-check-input; }
|
|
125
|
+
|
|
126
|
+
// Validation Classes
|
|
127
|
+
.is-valid { @include form-valid; }
|
|
128
|
+
.is-invalid { @include form-invalid; }
|
|
129
|
+
|
|
130
|
+
// Sizes
|
|
131
|
+
@for $i from 0 through 5 {
|
|
132
|
+
.form-input-#{$i} {
|
|
133
|
+
@include form-input;
|
|
134
|
+
padding: $i;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Dark Mode Support
|
|
139
|
+
// [data-theme="dark"] {
|
|
140
|
+
// .form-input,
|
|
141
|
+
// .form-select {
|
|
142
|
+
// background-color: var(--bg-secondary);
|
|
143
|
+
// border-color: var(--border-color-dark);
|
|
144
|
+
|
|
145
|
+
// &:focus {
|
|
146
|
+
// border-color: var(--primary-dark);
|
|
147
|
+
// }
|
|
148
|
+
// }
|
|
149
|
+
// }
|
|
150
|
+
|
|
151
|
+
// Accessibility
|
|
152
|
+
@media (prefers-reduced-motion: reduce) {
|
|
153
|
+
.form-input,
|
|
154
|
+
.form-label {
|
|
155
|
+
transition: none;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
File without changes
|