mtrl 0.0.0
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/LICENSE +21 -0
- package/README.md +251 -0
- package/index.js +10 -0
- package/package.json +17 -0
- package/src/components/button/api.js +54 -0
- package/src/components/button/button.js +81 -0
- package/src/components/button/config.js +8 -0
- package/src/components/button/constants.js +63 -0
- package/src/components/button/index.js +2 -0
- package/src/components/button/styles.scss +231 -0
- package/src/components/checkbox/api.js +45 -0
- package/src/components/checkbox/checkbox.js +95 -0
- package/src/components/checkbox/constants.js +88 -0
- package/src/components/checkbox/index.js +2 -0
- package/src/components/checkbox/styles.scss +183 -0
- package/src/components/container/api.js +42 -0
- package/src/components/container/container.js +45 -0
- package/src/components/container/index.js +2 -0
- package/src/components/container/styles.scss +59 -0
- package/src/components/list/constants.js +89 -0
- package/src/components/list/index.js +2 -0
- package/src/components/list/list-item.js +147 -0
- package/src/components/list/list.js +267 -0
- package/src/components/list/styles/_list-item.scss +142 -0
- package/src/components/list/styles/_list.scss +89 -0
- package/src/components/list/styles/_variables.scss +13 -0
- package/src/components/list/styles.scss +19 -0
- package/src/components/navigation/api.js +43 -0
- package/src/components/navigation/constants.js +235 -0
- package/src/components/navigation/features/items.js +192 -0
- package/src/components/navigation/index.js +2 -0
- package/src/components/navigation/nav-item.js +137 -0
- package/src/components/navigation/navigation.js +55 -0
- package/src/components/navigation/styles/_bar.scss +51 -0
- package/src/components/navigation/styles/_base.scss +129 -0
- package/src/components/navigation/styles/_drawer.scss +169 -0
- package/src/components/navigation/styles/_rail.scss +65 -0
- package/src/components/navigation/styles.scss +6 -0
- package/src/components/snackbar/api.js +125 -0
- package/src/components/snackbar/constants.js +41 -0
- package/src/components/snackbar/features.js +69 -0
- package/src/components/snackbar/index.js +2 -0
- package/src/components/snackbar/position.js +63 -0
- package/src/components/snackbar/queue.js +74 -0
- package/src/components/snackbar/snackbar.js +70 -0
- package/src/components/snackbar/styles.scss +182 -0
- package/src/components/switch/api.js +44 -0
- package/src/components/switch/constants.js +80 -0
- package/src/components/switch/index.js +2 -0
- package/src/components/switch/styles.scss +172 -0
- package/src/components/switch/switch.js +71 -0
- package/src/components/textfield/api.js +49 -0
- package/src/components/textfield/constants.js +81 -0
- package/src/components/textfield/index.js +2 -0
- package/src/components/textfield/styles/base.scss +107 -0
- package/src/components/textfield/styles/filled.scss +58 -0
- package/src/components/textfield/styles/outlined.scss +66 -0
- package/src/components/textfield/styles.scss +6 -0
- package/src/components/textfield/textfield.js +68 -0
- package/src/core/build/constants.js +51 -0
- package/src/core/build/icon.js +78 -0
- package/src/core/build/ripple.js +92 -0
- package/src/core/build/text.js +54 -0
- package/src/core/collection/adapters/base.js +26 -0
- package/src/core/collection/adapters/mongodb.js +232 -0
- package/src/core/collection/adapters/route.js +201 -0
- package/src/core/collection/collection.js +259 -0
- package/src/core/collection/list-manager.js +157 -0
- package/src/core/compose/base.js +8 -0
- package/src/core/compose/component.js +225 -0
- package/src/core/compose/features/checkable.js +114 -0
- package/src/core/compose/features/disabled.js +25 -0
- package/src/core/compose/features/events.js +48 -0
- package/src/core/compose/features/icon.js +33 -0
- package/src/core/compose/features/index.js +20 -0
- package/src/core/compose/features/input.js +92 -0
- package/src/core/compose/features/lifecycle.js +69 -0
- package/src/core/compose/features/position.js +60 -0
- package/src/core/compose/features/ripple.js +32 -0
- package/src/core/compose/features/size.js +9 -0
- package/src/core/compose/features/style.js +12 -0
- package/src/core/compose/features/text.js +17 -0
- package/src/core/compose/features/textinput.js +118 -0
- package/src/core/compose/features/textlabel.js +28 -0
- package/src/core/compose/features/track.js +49 -0
- package/src/core/compose/features/variant.js +9 -0
- package/src/core/compose/features/withEvents.js +67 -0
- package/src/core/compose/index.js +16 -0
- package/src/core/compose/pipe.js +69 -0
- package/src/core/config.js +140 -0
- package/src/core/dom/attributes.js +33 -0
- package/src/core/dom/classes.js +70 -0
- package/src/core/dom/create.js +133 -0
- package/src/core/dom/events.js +175 -0
- package/src/core/dom/index.js +5 -0
- package/src/core/dom/utils.js +22 -0
- package/src/core/index.js +23 -0
- package/src/core/layout/index.js +93 -0
- package/src/core/state/disabled.js +14 -0
- package/src/core/state/emitter.js +63 -0
- package/src/core/state/events.js +29 -0
- package/src/core/state/index.js +6 -0
- package/src/core/state/lifecycle.js +64 -0
- package/src/core/state/store.js +112 -0
- package/src/core/utils/index.js +39 -0
- package/src/core/utils/mobile.js +74 -0
- package/src/core/utils/object.js +22 -0
- package/src/core/utils/validate.js +37 -0
- package/src/index.js +11 -0
- package/src/styles/abstract/_base.scss +2 -0
- package/src/styles/abstract/_config.scss +28 -0
- package/src/styles/abstract/_functions.scss +124 -0
- package/src/styles/abstract/_mixins.scss +261 -0
- package/src/styles/abstract/_variables.scss +158 -0
- package/src/styles/main.scss +78 -0
- package/src/styles/themes/_base-theme.scss +49 -0
- package/src/styles/themes/_baseline.scss +90 -0
- package/src/styles/themes/_forest.scss +71 -0
- package/src/styles/themes/_index.scss +6 -0
- package/src/styles/themes/_ocean.scss +71 -0
- package/src/styles/themes/_sunset.scss +55 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// src/styles/abstract/_mixins.scss
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use 'sass:list';
|
|
4
|
+
@use 'variables' as v;
|
|
5
|
+
@use 'functions' as f;
|
|
6
|
+
|
|
7
|
+
// Typography
|
|
8
|
+
@mixin typography($scale) {
|
|
9
|
+
$styles: f.get-typography($scale);
|
|
10
|
+
font-family: map.get($styles, 'font-family');
|
|
11
|
+
font-size: map.get($styles, 'font-size');
|
|
12
|
+
line-height: map.get($styles, 'line-height');
|
|
13
|
+
letter-spacing: map.get($styles, 'letter-spacing');
|
|
14
|
+
font-weight: map.get($styles, 'font-weight');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// State Layers
|
|
18
|
+
@mixin state-layer($color, $state: 'hover', $selector: '&::before') {
|
|
19
|
+
position: relative;
|
|
20
|
+
|
|
21
|
+
#{$selector} {
|
|
22
|
+
content: '';
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset: 0;
|
|
25
|
+
background-color: $color;
|
|
26
|
+
opacity: f.get-state-opacity($state);
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
border-radius: inherit;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Elevation
|
|
33
|
+
@mixin elevation($level) {
|
|
34
|
+
box-shadow: f.get-elevation($level);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Motion
|
|
38
|
+
@mixin motion-transition($properties...) {
|
|
39
|
+
$transitions: ();
|
|
40
|
+
@each $prop in $properties {
|
|
41
|
+
$transitions: list.append(
|
|
42
|
+
$transitions,
|
|
43
|
+
$prop f.get-motion-duration('short2') f.get-motion-easing('standard'),
|
|
44
|
+
comma
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
transition: $transitions;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@mixin motion-exit($properties...) {
|
|
51
|
+
$transitions: ();
|
|
52
|
+
@each $prop in $properties {
|
|
53
|
+
$transitions: list.append(
|
|
54
|
+
$transitions,
|
|
55
|
+
$prop f.get-motion-duration('short4') f.get-motion-easing('standard-accelerate'),
|
|
56
|
+
comma
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
transition: $transitions;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@mixin motion-enter($properties...) {
|
|
63
|
+
$transitions: ();
|
|
64
|
+
@each $prop in $properties {
|
|
65
|
+
$transitions: list.append(
|
|
66
|
+
$transitions,
|
|
67
|
+
$prop f.get-motion-duration('short4') f.get-motion-easing('standard-decelerate'),
|
|
68
|
+
comma
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
transition: $transitions;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Focus Ring
|
|
75
|
+
@mixin focus-ring($color: var(--#{v.$prefix}-sys-color-primary), $width: 2px, $offset: 2px) {
|
|
76
|
+
&:focus-visible {
|
|
77
|
+
outline: $width solid $color;
|
|
78
|
+
outline-offset: $offset;
|
|
79
|
+
@include elevation(1);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Interactive States
|
|
84
|
+
@mixin interactive-states($config: ()) {
|
|
85
|
+
$default-config: (
|
|
86
|
+
base-color: var(--#{v.$prefix}-sys-color-primary),
|
|
87
|
+
hover-state: true,
|
|
88
|
+
focus-state: true,
|
|
89
|
+
active-state: true,
|
|
90
|
+
disabled-state: true,
|
|
91
|
+
disabled-opacity: 0.38
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
$config: map.merge($default-config, $config);
|
|
95
|
+
|
|
96
|
+
@if map.get($config, hover-state) {
|
|
97
|
+
&:hover {
|
|
98
|
+
@include state-layer(map.get($config, base-color), 'hover');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@if map.get($config, focus-state) {
|
|
103
|
+
&:focus {
|
|
104
|
+
@include state-layer(map.get($config, base-color), 'focus');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@if map.get($config, active-state) {
|
|
109
|
+
&:active {
|
|
110
|
+
@include state-layer(map.get($config, base-color), 'pressed');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@if map.get($config, disabled-state) {
|
|
115
|
+
&:disabled {
|
|
116
|
+
opacity: map.get($config, disabled-opacity);
|
|
117
|
+
pointer-events: none;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Layout
|
|
123
|
+
@mixin flex-center {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@mixin center-content {
|
|
130
|
+
position: absolute;
|
|
131
|
+
top: 50%;
|
|
132
|
+
left: 50%;
|
|
133
|
+
transform: translate(-50%, -50%);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@mixin container($max-width: 1200px, $padding: 24px) {
|
|
137
|
+
width: 100%;
|
|
138
|
+
max-width: $max-width;
|
|
139
|
+
margin-inline: auto;
|
|
140
|
+
padding-inline: $padding;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Text
|
|
144
|
+
@mixin truncate($lines: 1) {
|
|
145
|
+
@if $lines == 1 {
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
text-overflow: ellipsis;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
} @else {
|
|
150
|
+
display: -webkit-box;
|
|
151
|
+
-webkit-line-clamp: $lines;
|
|
152
|
+
-webkit-box-orient: vertical;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Shape
|
|
158
|
+
@mixin shape($size) {
|
|
159
|
+
border-radius: f.get-shape($size);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Media Queries
|
|
163
|
+
@mixin breakpoint-up($size) {
|
|
164
|
+
@media (min-width: f.get-breakpoint($size)) {
|
|
165
|
+
@content;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@mixin breakpoint-down($size) {
|
|
170
|
+
@media (max-width: f.get-breakpoint($size) - 1) {
|
|
171
|
+
@content;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@mixin breakpoint-between($min, $max) {
|
|
176
|
+
@media (min-width: f.get-breakpoint($min)) and (max-width: f.get-breakpoint($max) - 1) {
|
|
177
|
+
@content;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// A11y
|
|
182
|
+
@mixin visually-hidden {
|
|
183
|
+
position: absolute;
|
|
184
|
+
width: 1px;
|
|
185
|
+
height: 1px;
|
|
186
|
+
padding: 0;
|
|
187
|
+
margin: -1px;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
clip: rect(0, 0, 0, 0);
|
|
190
|
+
white-space: nowrap;
|
|
191
|
+
border: 0;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@mixin reduced-motion {
|
|
195
|
+
@media (prefers-reduced-motion: reduce) {
|
|
196
|
+
@content;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@mixin high-contrast {
|
|
201
|
+
@media (forced-colors: active) {
|
|
202
|
+
@content;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// RTL Support
|
|
207
|
+
@mixin rtl {
|
|
208
|
+
[dir='rtl'] & {
|
|
209
|
+
@content;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Touch Target
|
|
214
|
+
@mixin touch-target($size: 48px) {
|
|
215
|
+
position: relative;
|
|
216
|
+
|
|
217
|
+
&::after {
|
|
218
|
+
content: '';
|
|
219
|
+
position: absolute;
|
|
220
|
+
inset: 50%;
|
|
221
|
+
width: $size;
|
|
222
|
+
height: $size;
|
|
223
|
+
transform: translate(-50%, -50%);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Scrollbars
|
|
228
|
+
@mixin custom-scrollbar($config: ()) {
|
|
229
|
+
$default-config: (
|
|
230
|
+
width: 8px,
|
|
231
|
+
track-color: transparent,
|
|
232
|
+
thumb-color: rgba(0, 0, 0, 0.2),
|
|
233
|
+
thumb-hover-color: rgba(0, 0, 0, 0.3)
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
$config: map.merge($default-config, $config);
|
|
237
|
+
|
|
238
|
+
&::-webkit-scrollbar {
|
|
239
|
+
width: map.get($config, width);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&::-webkit-scrollbar-track {
|
|
243
|
+
background: map.get($config, track-color);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&::-webkit-scrollbar-thumb {
|
|
247
|
+
background: map.get($config, thumb-color);
|
|
248
|
+
border-radius: f.get-shape('full');
|
|
249
|
+
|
|
250
|
+
&:hover {
|
|
251
|
+
background: map.get($config, thumb-hover-color);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Print
|
|
257
|
+
@mixin print {
|
|
258
|
+
@media print {
|
|
259
|
+
@content;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// src/styles/abstract/_variables.scss
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
|
|
4
|
+
// Core configuration
|
|
5
|
+
$prefix: 'mtrl' !default;
|
|
6
|
+
|
|
7
|
+
// Design tokens
|
|
8
|
+
$state: (
|
|
9
|
+
'hover-state-layer-opacity': 0.08,
|
|
10
|
+
'pressed-state-layer-opacity': 0.12,
|
|
11
|
+
'focus-state-layer-opacity': 0.12,
|
|
12
|
+
'dragged-state-layer-opacity': 0.16
|
|
13
|
+
) !default;
|
|
14
|
+
|
|
15
|
+
$motion: (
|
|
16
|
+
'duration-short1': 100ms,
|
|
17
|
+
'duration-short2': 200ms,
|
|
18
|
+
'duration-short3': 250ms,
|
|
19
|
+
'duration-short4': 300ms,
|
|
20
|
+
'duration-medium1': 400ms,
|
|
21
|
+
'duration-medium2': 500ms,
|
|
22
|
+
'duration-long1': 600ms,
|
|
23
|
+
'duration-long2': 700ms,
|
|
24
|
+
'easing-standard': cubic-bezier(0.2, 0.0, 0.0, 1.0),
|
|
25
|
+
'easing-standard-accelerate': cubic-bezier(0.3, 0.0, 1.0, 1.0),
|
|
26
|
+
'easing-standard-decelerate': cubic-bezier(0.0, 0.0, 0.2, 1.0),
|
|
27
|
+
'easing-emphasized': cubic-bezier(0.2, 0.0, 0.0, 1.0),
|
|
28
|
+
'easing-emphasized-accelerate': cubic-bezier(0.3, 0.0, 0.8, 0.15),
|
|
29
|
+
'easing-emphasized-decelerate': cubic-bezier(0.05, 0.7, 0.1, 1.0)
|
|
30
|
+
) !default;
|
|
31
|
+
|
|
32
|
+
$elevation: (
|
|
33
|
+
'level-0': none,
|
|
34
|
+
'level-1': (0px 1px 2px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15)),
|
|
35
|
+
'level-2': (0px 1px 2px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15)),
|
|
36
|
+
'level-3': (0px 1px 3px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15)),
|
|
37
|
+
'level-4': (0px 2px 3px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15)),
|
|
38
|
+
'level-5': (0px 4px 4px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15))
|
|
39
|
+
) !default;
|
|
40
|
+
|
|
41
|
+
$typescale: (
|
|
42
|
+
'display-large': (
|
|
43
|
+
'font-family': ('Roboto', sans-serif),
|
|
44
|
+
'font-size': 57px,
|
|
45
|
+
'line-height': 64px,
|
|
46
|
+
'letter-spacing': -0.25px,
|
|
47
|
+
'font-weight': 400
|
|
48
|
+
),
|
|
49
|
+
'display-medium': (
|
|
50
|
+
'font-family': ('Roboto', sans-serif),
|
|
51
|
+
'font-size': 45px,
|
|
52
|
+
'line-height': 52px,
|
|
53
|
+
'letter-spacing': 0,
|
|
54
|
+
'font-weight': 400
|
|
55
|
+
),
|
|
56
|
+
'display-small': (
|
|
57
|
+
'font-family': ('Roboto', sans-serif),
|
|
58
|
+
'font-size': 36px,
|
|
59
|
+
'line-height': 44px,
|
|
60
|
+
'letter-spacing': 0,
|
|
61
|
+
'font-weight': 400
|
|
62
|
+
),
|
|
63
|
+
'headline-large': (
|
|
64
|
+
'font-family': ('Roboto', sans-serif),
|
|
65
|
+
'font-size': 32px,
|
|
66
|
+
'line-height': 40px,
|
|
67
|
+
'letter-spacing': 0,
|
|
68
|
+
'font-weight': 400
|
|
69
|
+
),
|
|
70
|
+
'headline-medium': (
|
|
71
|
+
'font-family': ('Roboto', sans-serif),
|
|
72
|
+
'font-size': 28px,
|
|
73
|
+
'line-height': 36px,
|
|
74
|
+
'letter-spacing': 0,
|
|
75
|
+
'font-weight': 400
|
|
76
|
+
),
|
|
77
|
+
'headline-small': (
|
|
78
|
+
'font-family': ('Roboto', sans-serif),
|
|
79
|
+
'font-size': 24px,
|
|
80
|
+
'line-height': 32px,
|
|
81
|
+
'letter-spacing': 0,
|
|
82
|
+
'font-weight': 400
|
|
83
|
+
),
|
|
84
|
+
'body-large': (
|
|
85
|
+
'font-family': ('Roboto', sans-serif),
|
|
86
|
+
'font-size': 16px,
|
|
87
|
+
'line-height': 24px,
|
|
88
|
+
'letter-spacing': 0.5px,
|
|
89
|
+
'font-weight': 400
|
|
90
|
+
),
|
|
91
|
+
'body-medium': (
|
|
92
|
+
'font-family': ('Roboto', sans-serif),
|
|
93
|
+
'font-size': 14px,
|
|
94
|
+
'line-height': 20px,
|
|
95
|
+
'letter-spacing': 0.25px,
|
|
96
|
+
'font-weight': 400
|
|
97
|
+
),
|
|
98
|
+
'body-small': (
|
|
99
|
+
'font-family': ('Roboto', sans-serif),
|
|
100
|
+
'font-size': 12px,
|
|
101
|
+
'line-height': 16px,
|
|
102
|
+
'letter-spacing': 0.4px,
|
|
103
|
+
'font-weight': 400
|
|
104
|
+
),
|
|
105
|
+
'label-large': (
|
|
106
|
+
'font-family': ('Roboto', sans-serif),
|
|
107
|
+
'font-size': 14px,
|
|
108
|
+
'line-height': 20px,
|
|
109
|
+
'letter-spacing': 0.1px,
|
|
110
|
+
'font-weight': 500
|
|
111
|
+
),
|
|
112
|
+
'label-medium': (
|
|
113
|
+
'font-family': ('Roboto', sans-serif),
|
|
114
|
+
'font-size': 12px,
|
|
115
|
+
'line-height': 16px,
|
|
116
|
+
'letter-spacing': 0.5px,
|
|
117
|
+
'font-weight': 500
|
|
118
|
+
),
|
|
119
|
+
'label-small': (
|
|
120
|
+
'font-family': ('Roboto', sans-serif),
|
|
121
|
+
'font-size': 11px,
|
|
122
|
+
'line-height': 16px,
|
|
123
|
+
'letter-spacing': 0.5px,
|
|
124
|
+
'font-weight': 500
|
|
125
|
+
)
|
|
126
|
+
) !default;
|
|
127
|
+
|
|
128
|
+
$shape: (
|
|
129
|
+
'none': 0,
|
|
130
|
+
'extra-small': 4px,
|
|
131
|
+
'small': 8px,
|
|
132
|
+
'medium': 12px,
|
|
133
|
+
'large': 16px,
|
|
134
|
+
'extra-large': 28px,
|
|
135
|
+
'full': 9999px,
|
|
136
|
+
'pill': 100px
|
|
137
|
+
) !default;
|
|
138
|
+
|
|
139
|
+
$breakpoints: (
|
|
140
|
+
'xs': 0,
|
|
141
|
+
'sm': 600px,
|
|
142
|
+
'md': 960px,
|
|
143
|
+
'lg': 1280px,
|
|
144
|
+
'xl': 1920px
|
|
145
|
+
) !default;
|
|
146
|
+
|
|
147
|
+
$z-index: (
|
|
148
|
+
'modal': 1000,
|
|
149
|
+
'popover': 900,
|
|
150
|
+
'drawer': 800,
|
|
151
|
+
'dialog': 700,
|
|
152
|
+
'dropdown': 600,
|
|
153
|
+
'tooltip': 500,
|
|
154
|
+
'sticky': 100,
|
|
155
|
+
'fixed': 50,
|
|
156
|
+
'default': 1,
|
|
157
|
+
'below': -1
|
|
158
|
+
) !default;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// src/styles/main.scss
|
|
2
|
+
|
|
3
|
+
// Abstract
|
|
4
|
+
@import 'abstract/variables';
|
|
5
|
+
@import 'abstract/functions';
|
|
6
|
+
@import 'abstract/mixins';
|
|
7
|
+
@import 'abstract/theme';
|
|
8
|
+
|
|
9
|
+
// Components
|
|
10
|
+
@import '../components/button/styles';
|
|
11
|
+
|
|
12
|
+
// Initialize theme
|
|
13
|
+
:root {
|
|
14
|
+
@each $key, $value in $mtrl-sys-state {
|
|
15
|
+
--mtrl-sys-state-#{$key}: #{$value};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@each $key, $value in $mtrl-sys-motion {
|
|
19
|
+
--mtrl-sys-motion-#{$key}: #{$value};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@each $key, $value in $mtrl-sys-shape {
|
|
23
|
+
--mtrl-sys-shape-#{$key}: #{$value};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// // Default light theme colors
|
|
27
|
+
// --mtrl-sys-color-primary: #6750A4;
|
|
28
|
+
// --mtrl-sys-color-primary-rgb: 103, 80, 164;
|
|
29
|
+
// --mtrl-sys-color-on-primary: #FFFFFF;
|
|
30
|
+
// --mtrl-sys-color-primary-container: #EADDFF;
|
|
31
|
+
// --mtrl-sys-color-on-primary-container: #21005D;
|
|
32
|
+
|
|
33
|
+
// --mtrl-sys-color-secondary: #625B71;
|
|
34
|
+
// --mtrl-sys-color-on-secondary: #FFFFFF;
|
|
35
|
+
// --mtrl-sys-color-secondary-container: #E8DEF8;
|
|
36
|
+
// --mtrl-sys-color-on-secondary-container: #1D192B;
|
|
37
|
+
|
|
38
|
+
// --mtrl-sys-color-surface: #FFFBFE;
|
|
39
|
+
// --mtrl-sys-color-on-surface: #1C1B1F;
|
|
40
|
+
// --mtrl-sys-color-surface-container: #F3EDF7;
|
|
41
|
+
// --mtrl-sys-color-on-surface-rgb: 28, 27, 31;
|
|
42
|
+
|
|
43
|
+
// --mtrl-sys-color-outline: #79747E;
|
|
44
|
+
// }
|
|
45
|
+
|
|
46
|
+
// // Dark theme
|
|
47
|
+
// [data-theme="dark"] {
|
|
48
|
+
// --mtrl-sys-color-primary: #D0BCFF;
|
|
49
|
+
// --mtrl-sys-color-primary-rgb: 208, 188, 255;
|
|
50
|
+
// --mtrl-sys-color-on-primary: #381E72;
|
|
51
|
+
// --mtrl-sys-color-primary-container: #4F378B;
|
|
52
|
+
// --mtrl-sys-color-on-primary-container: #EADDFF;
|
|
53
|
+
|
|
54
|
+
// --mtrl-sys-color-secondary: #CCC2DC;
|
|
55
|
+
// --mtrl-sys-color-on-secondary: #332D41;
|
|
56
|
+
// --mtrl-sys-color-secondary-container: #4A4458;
|
|
57
|
+
// --mtrl-sys-color-on-secondary-container: #E8DEF8;
|
|
58
|
+
|
|
59
|
+
// --mtrl-sys-color-surface: #1C1B1F;
|
|
60
|
+
// --mtrl-sys-color-on-surface: #E6E1E5;
|
|
61
|
+
// --mtrl-sys-color-surface-container: #211F26;
|
|
62
|
+
// --mtrl-sys-color-on-surface-rgb: 230, 225, 229;
|
|
63
|
+
|
|
64
|
+
// --mtrl-sys-color-outline: #938F99;
|
|
65
|
+
// }
|
|
66
|
+
|
|
67
|
+
// Base styles
|
|
68
|
+
body {
|
|
69
|
+
margin: 0;
|
|
70
|
+
padding: 0;
|
|
71
|
+
background-color: var(--mtrl-sys-color-surface);
|
|
72
|
+
color: var(--mtrl-sys-color-on-surface);
|
|
73
|
+
font-family: var(--mtrl-sys-typescale-body-medium-font-family-name, 'Roboto'), sans-serif;
|
|
74
|
+
-webkit-font-smoothing: antialiased;
|
|
75
|
+
-moz-osx-font-smoothing: grayscale;
|
|
76
|
+
|
|
77
|
+
@include motion-transition(background-color, color);
|
|
78
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// src/styles/themes/_default.scss
|
|
2
|
+
@use '../abstract/base' as *;
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// Base theme definition with common properties and structure
|
|
6
|
+
@mixin create-theme($name) {
|
|
7
|
+
[data-theme="#{$name}"] {
|
|
8
|
+
@content;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
%theme-base {
|
|
13
|
+
// Common properties for all themes
|
|
14
|
+
--#{$prefix}-sys-typescale-label-large-font-family-name: "Roboto";
|
|
15
|
+
--#{$prefix}-sys-typescale-label-large-font-weight: 500;
|
|
16
|
+
--#{$prefix}-sys-typescale-label-large-size: 0.875rem;
|
|
17
|
+
--#{$prefix}-sys-typescale-label-large-line-height: 1.25rem;
|
|
18
|
+
--#{$prefix}-sys-typescale-label-large-letter-spacing: 0.00625rem;
|
|
19
|
+
|
|
20
|
+
--#{$prefix}-sys-shape-corner-extra-small: 4px;
|
|
21
|
+
--#{$prefix}-sys-shape-corner-small: 8px;
|
|
22
|
+
--#{$prefix}-sys-shape-corner-medium: 12px;
|
|
23
|
+
--#{$prefix}-sys-shape-corner-large: 16px;
|
|
24
|
+
--#{$prefix}-sys-shape-corner-extra-large: 28px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:root {
|
|
28
|
+
// Color scheme
|
|
29
|
+
--#{$prefix}-sys-color-primary: #6750A4;
|
|
30
|
+
--#{$prefix}-sys-color-primary-rgb: 103, 80, 164;
|
|
31
|
+
--#{$prefix}-sys-color-on-primary: #FFFFFF;
|
|
32
|
+
--#{$prefix}-sys-color-primary-container: #EADDFF;
|
|
33
|
+
--#{$prefix}-sys-color-on-primary-container: #21005D;
|
|
34
|
+
|
|
35
|
+
--#{$prefix}-sys-color-secondary: #625B71;
|
|
36
|
+
--#{$prefix}-sys-color-on-secondary: #FFFFFF;
|
|
37
|
+
--#{$prefix}-sys-color-secondary-container: #E8DEF8;
|
|
38
|
+
--#{$prefix}-sys-color-on-secondary-container: #1D192B;
|
|
39
|
+
|
|
40
|
+
--#{$prefix}-sys-color-surface: #FFFBFE;
|
|
41
|
+
--#{$prefix}-sys-color-on-surface: #1C1B1F;
|
|
42
|
+
--#{$prefix}-sys-color-on-surface-rgb: 28, 27, 31;
|
|
43
|
+
|
|
44
|
+
--#{$prefix}-sys-color-outline: #79747E;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// [data-theme="dark"] {
|
|
48
|
+
// @include dark-theme;
|
|
49
|
+
// }
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// src/styles/themes/_baseline.scss
|
|
2
|
+
@use '../abstract/base' as *;
|
|
3
|
+
@use 'base-theme' as *;
|
|
4
|
+
|
|
5
|
+
// Material Design 3 Baseline Theme
|
|
6
|
+
@include create-theme('baseline') {
|
|
7
|
+
// Key colors
|
|
8
|
+
--#{$prefix}-sys-color-primary: #6750A4;
|
|
9
|
+
--#{$prefix}-sys-color-on-primary: #FFFFFF;
|
|
10
|
+
--#{$prefix}-sys-color-primary-container: #EADDFF;
|
|
11
|
+
--#{$prefix}-sys-color-on-primary-container: #21005D;
|
|
12
|
+
|
|
13
|
+
--#{$prefix}-sys-color-secondary: #625B71;
|
|
14
|
+
--#{$prefix}-sys-color-on-secondary: #FFFFFF;
|
|
15
|
+
--#{$prefix}-sys-color-secondary-container: #E8DEF8;
|
|
16
|
+
--#{$prefix}-sys-color-on-secondary-container: #1D192B;
|
|
17
|
+
|
|
18
|
+
--#{$prefix}-sys-color-tertiary: #7D5260;
|
|
19
|
+
--#{$prefix}-sys-color-on-tertiary: #FFFFFF;
|
|
20
|
+
--#{$prefix}-sys-color-tertiary-container: #FFD8E4;
|
|
21
|
+
--#{$prefix}-sys-color-on-tertiary-container: #31111D;
|
|
22
|
+
|
|
23
|
+
// Neutral colors
|
|
24
|
+
--#{$prefix}-sys-color-surface: #FFFBFE;
|
|
25
|
+
--#{$prefix}-sys-color-surface-dim: #DED8E1;
|
|
26
|
+
--#{$prefix}-sys-color-surface-bright: #FFF8F7;
|
|
27
|
+
--#{$prefix}-sys-color-surface-container-lowest: #FFFFFF;
|
|
28
|
+
--#{$prefix}-sys-color-surface-container-low: #F7F2FA;
|
|
29
|
+
--#{$prefix}-sys-color-surface-container: #F3EDF7;
|
|
30
|
+
--#{$prefix}-sys-color-surface-container-high: #ECE6F0;
|
|
31
|
+
--#{$prefix}-sys-color-surface-container-highest: #E6E0E9;
|
|
32
|
+
|
|
33
|
+
--#{$prefix}-sys-color-on-surface: #1C1B1F;
|
|
34
|
+
--#{$prefix}-sys-color-on-surface-variant: #49454F;
|
|
35
|
+
|
|
36
|
+
// Additional colors
|
|
37
|
+
--#{$prefix}-sys-color-outline: #79747E;
|
|
38
|
+
--#{$prefix}-sys-color-outline-variant: #CAC4D0;
|
|
39
|
+
--#{$prefix}-sys-color-shadow: #000000;
|
|
40
|
+
--#{$prefix}-sys-color-scrim: #000000;
|
|
41
|
+
--#{$prefix}-sys-color-inverse-surface: #313033;
|
|
42
|
+
--#{$prefix}-sys-color-inverse-on-surface: #F4EFF4;
|
|
43
|
+
--#{$prefix}-sys-color-inverse-primary: #D0BCFF;
|
|
44
|
+
|
|
45
|
+
// State layers
|
|
46
|
+
--#{$prefix}-sys-state-hover-state-layer-opacity: 0.08;
|
|
47
|
+
--#{$prefix}-sys-state-focus-state-layer-opacity: 0.12;
|
|
48
|
+
--#{$prefix}-sys-state-pressed-state-layer-opacity: 0.12;
|
|
49
|
+
--#{$prefix}-sys-state-dragged-state-layer-opacity: 0.16;
|
|
50
|
+
|
|
51
|
+
&[data-theme-mode="dark"] {
|
|
52
|
+
// Key colors
|
|
53
|
+
--#{$prefix}-sys-color-primary: #D0BCFF;
|
|
54
|
+
--#{$prefix}-sys-color-on-primary: #381E72;
|
|
55
|
+
--#{$prefix}-sys-color-primary-container: #4F378B;
|
|
56
|
+
--#{$prefix}-sys-color-on-primary-container: #EADDFF;
|
|
57
|
+
|
|
58
|
+
--#{$prefix}-sys-color-secondary: #CCC2DC;
|
|
59
|
+
--#{$prefix}-sys-color-on-secondary: #332D41;
|
|
60
|
+
--#{$prefix}-sys-color-secondary-container: #4A4458;
|
|
61
|
+
--#{$prefix}-sys-color-on-secondary-container: #E8DEF8;
|
|
62
|
+
|
|
63
|
+
--#{$prefix}-sys-color-tertiary: #EFB8C8;
|
|
64
|
+
--#{$prefix}-sys-color-on-tertiary: #492532;
|
|
65
|
+
--#{$prefix}-sys-color-tertiary-container: #633B48;
|
|
66
|
+
--#{$prefix}-sys-color-on-tertiary-container: #FFD8E4;
|
|
67
|
+
|
|
68
|
+
// Neutral colors
|
|
69
|
+
--#{$prefix}-sys-color-surface: #1C1B1F;
|
|
70
|
+
--#{$prefix}-sys-color-surface-dim: #141218;
|
|
71
|
+
--#{$prefix}-sys-color-surface-bright: #3B383D;
|
|
72
|
+
--#{$prefix}-sys-color-surface-container-lowest: #0F0D13;
|
|
73
|
+
--#{$prefix}-sys-color-surface-container-low: #1D1B20;
|
|
74
|
+
--#{$prefix}-sys-color-surface-container: #211F26;
|
|
75
|
+
--#{$prefix}-sys-color-surface-container-high: #2B2930;
|
|
76
|
+
--#{$prefix}-sys-color-surface-container-highest: #36343B;
|
|
77
|
+
|
|
78
|
+
--#{$prefix}-sys-color-on-surface: #E6E1E5;
|
|
79
|
+
--#{$prefix}-sys-color-on-surface-variant: #CAC4D0;
|
|
80
|
+
|
|
81
|
+
// Additional colors
|
|
82
|
+
--#{$prefix}-sys-color-outline: #938F99;
|
|
83
|
+
--#{$prefix}-sys-color-outline-variant: #444746;
|
|
84
|
+
--#{$prefix}-sys-color-shadow: #000000;
|
|
85
|
+
--#{$prefix}-sys-color-scrim: #000000;
|
|
86
|
+
--#{$prefix}-sys-color-inverse-surface: #E6E1E5;
|
|
87
|
+
--#{$prefix}-sys-color-inverse-on-surface: #313033;
|
|
88
|
+
--#{$prefix}-sys-color-inverse-primary: #6750A4;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// src/styles/themes/_forest.scss
|
|
2
|
+
@use '../abstract/base' as *;
|
|
3
|
+
@use 'base-theme' as *;
|
|
4
|
+
|
|
5
|
+
@include create-theme('forest') {
|
|
6
|
+
// Key colors generated from seed color #2E7D32
|
|
7
|
+
--#{$prefix}-sys-color-primary: #146C2E;
|
|
8
|
+
--#{$prefix}-sys-color-on-primary: #FFFFFF;
|
|
9
|
+
--#{$prefix}-sys-color-primary-container: #9FF6A5;
|
|
10
|
+
--#{$prefix}-sys-color-on-primary-container: #002107;
|
|
11
|
+
|
|
12
|
+
--#{$prefix}-sys-color-secondary: #516351;
|
|
13
|
+
--#{$prefix}-sys-color-on-secondary: #FFFFFF;
|
|
14
|
+
--#{$prefix}-sys-color-secondary-container: #D4E8D2;
|
|
15
|
+
--#{$prefix}-sys-color-on-secondary-container: #0F1F0F;
|
|
16
|
+
|
|
17
|
+
--#{$prefix}-sys-color-tertiary: #38656A;
|
|
18
|
+
--#{$prefix}-sys-color-on-tertiary: #FFFFFF;
|
|
19
|
+
--#{$prefix}-sys-color-tertiary-container: #BCEBF0;
|
|
20
|
+
--#{$prefix}-sys-color-on-tertiary-container: #002023;
|
|
21
|
+
|
|
22
|
+
// Neutral colors
|
|
23
|
+
--#{$prefix}-sys-color-surface: #FBFDF7;
|
|
24
|
+
--#{$prefix}-sys-color-surface-dim: #DBE5D8;
|
|
25
|
+
--#{$prefix}-sys-color-surface-bright: #FBFDF7;
|
|
26
|
+
--#{$prefix}-sys-color-surface-container-lowest: #FFFFFF;
|
|
27
|
+
--#{$prefix}-sys-color-surface-container-low: #F5F9F2;
|
|
28
|
+
--#{$prefix}-sys-color-surface-container: #EFF4EC;
|
|
29
|
+
--#{$prefix}-sys-color-surface-container-high: #E9EEE6;
|
|
30
|
+
--#{$prefix}-sys-color-surface-container-highest: #E3E8E0;
|
|
31
|
+
|
|
32
|
+
--#{$prefix}-sys-color-on-surface: #191C19;
|
|
33
|
+
--#{$prefix}-sys-color-on-surface-variant: #414942;
|
|
34
|
+
|
|
35
|
+
--#{$prefix}-sys-color-outline: #717971;
|
|
36
|
+
--#{$prefix}-sys-color-outline-variant: #C1C9C1;
|
|
37
|
+
|
|
38
|
+
&[data-theme-mode="dark"] {
|
|
39
|
+
// Key colors
|
|
40
|
+
--#{$prefix}-sys-color-primary: #83D989;
|
|
41
|
+
--#{$prefix}-sys-color-on-primary: #003911;
|
|
42
|
+
--#{$prefix}-sys-color-primary-container: #00531B;
|
|
43
|
+
--#{$prefix}-sys-color-on-primary-container: #9FF6A5;
|
|
44
|
+
|
|
45
|
+
--#{$prefix}-sys-color-secondary: #B8CCB7;
|
|
46
|
+
--#{$prefix}-sys-color-on-secondary: #243424;
|
|
47
|
+
--#{$prefix}-sys-color-secondary-container: #3A4B3A;
|
|
48
|
+
--#{$prefix}-sys-color-on-secondary-container: #D4E8D2;
|
|
49
|
+
|
|
50
|
+
--#{$prefix}-sys-color-tertiary: #A0CFD4;
|
|
51
|
+
--#{$prefix}-sys-color-on-tertiary: #003739;
|
|
52
|
+
--#{$prefix}-sys-color-tertiary-container: #1E4D51;
|
|
53
|
+
--#{$prefix}-sys-color-on-tertiary-container: #BCEBF0;
|
|
54
|
+
|
|
55
|
+
// Neutral colors
|
|
56
|
+
--#{$prefix}-sys-color-surface: #191C19;
|
|
57
|
+
--#{$prefix}-sys-color-surface-dim: #101410;
|
|
58
|
+
--#{$prefix}-sys-color-surface-bright: #373B37;
|
|
59
|
+
--#{$prefix}-sys-color-surface-container-lowest: #0C100C;
|
|
60
|
+
--#{$prefix}-sys-color-surface-container-low: #191C19;
|
|
61
|
+
--#{$prefix}-sys-color-surface-container: #1D201D;
|
|
62
|
+
--#{$prefix}-sys-color-surface-container-high: #272B27;
|
|
63
|
+
--#{$prefix}-sys-color-surface-container-highest: #323532;
|
|
64
|
+
|
|
65
|
+
--#{$prefix}-sys-color-on-surface: #E1E3E1;
|
|
66
|
+
--#{$prefix}-sys-color-on-surface-variant: #C1C9C1;
|
|
67
|
+
|
|
68
|
+
--#{$prefix}-sys-color-outline: #8B938B;
|
|
69
|
+
--#{$prefix}-sys-color-outline-variant: #414942;
|
|
70
|
+
}
|
|
71
|
+
}
|