material-inspired-component-library 7.0.1 → 8.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/CLAUDE.md +42 -0
- package/README.md +6 -0
- package/components/accordion/README.md +6 -3
- package/components/appbar/index.scss +1 -1
- package/components/button/index.scss +10 -6
- package/components/card/README.md +4 -0
- package/components/card/index.scss +160 -151
- package/components/checkbox/index.scss +11 -6
- package/components/datepicker/index.ts +9 -9
- package/components/dialog/index.scss +5 -6
- package/components/iconbutton/index.scss +10 -6
- package/components/list/README.md +191 -32
- package/components/list/index.scss +256 -190
- package/components/list/index.ts +100 -100
- package/components/menu/README.md +199 -10
- package/components/menu/index.scss +224 -47
- package/components/menu/index.ts +74 -37
- package/components/navigationrail/index.scss +75 -69
- package/components/radio/index.scss +11 -6
- package/components/select/README.md +42 -5
- package/components/select/index.scss +39 -79
- package/components/stepper/index.scss +1 -5
- package/components/stepper/index.ts +1 -1
- package/components/textfield/index.scss +1 -1
- package/components/textfield/index.ts +2 -2
- package/components/timepicker/index.ts +2 -2
- package/dist/alert.css +1 -1
- package/dist/appbar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/bottomsheet.css +1 -1
- package/dist/button.css +1 -1
- package/dist/card.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/components/list/index.d.ts +2 -2
- package/dist/datepicker.css +1 -1
- package/dist/dialog.css +1 -1
- package/dist/divider.css +1 -1
- package/dist/foundations.css +1 -1
- package/dist/iconbutton.css +1 -1
- package/dist/list.css +1 -1
- package/dist/menu.css +1 -1
- package/dist/micl.css +1 -1
- package/dist/micl.js +1 -1
- package/dist/navigationrail.css +1 -1
- package/dist/radio.css +1 -1
- package/dist/select.css +1 -1
- package/dist/sidesheet.css +1 -1
- package/dist/slider.css +1 -1
- package/dist/snackbar.css +1 -1
- package/dist/stepper.css +1 -1
- package/dist/switch.css +1 -1
- package/dist/textfield.css +1 -1
- package/dist/timepicker.css +1 -1
- package/docs/accordion.html +24 -24
- package/docs/bottomsheet.html +1 -4
- package/docs/dialog.html +1 -1
- package/docs/index.html +5 -5
- package/docs/list.html +38 -22
- package/docs/menu.html +246 -41
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/docs/select.html +68 -19
- package/docs/shapes.html +85 -0
- package/foundations/index.scss +0 -1
- package/micl.ts +54 -36
- package/package.json +3 -3
- package/styles/README.md +14 -4
- package/styles/shapes.scss +81 -0
- package/styles/statelayer.scss +10 -0
- package/styles/typography.scss +38 -2
- package/tsconfig.json +4 -4
package/micl.ts
CHANGED
|
@@ -32,16 +32,21 @@ import _stepper, { stepperSelector } from './components/stepper';
|
|
|
32
32
|
import _textfield, { textfieldSelector, textareaSelector, selectSelector } from './components/textfield';
|
|
33
33
|
import _timepicker, { timepickerSelector } from './components/timepicker';
|
|
34
34
|
|
|
35
|
+
interface ComponentEventHandlers {
|
|
36
|
+
input? : (event: Event) => void;
|
|
37
|
+
keydown?: (event: Event) => void;
|
|
38
|
+
change? : (event: Event) => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
interface ComponentEntry<T extends HTMLElement> {
|
|
36
|
-
component: {
|
|
37
|
-
initialize?: (element: T) => void
|
|
38
|
-
|
|
39
|
-
keydown? : (event: Event) => void,
|
|
40
|
-
cleanup? : (element: T) => void
|
|
42
|
+
component: ComponentEventHandlers & {
|
|
43
|
+
initialize?: (element: T) => void;
|
|
44
|
+
cleanup? : (element: T) => void;
|
|
41
45
|
};
|
|
42
46
|
type: new () => T;
|
|
43
47
|
}
|
|
44
|
-
|
|
48
|
+
|
|
49
|
+
type EventHandlerKey = keyof ComponentEventHandlers;
|
|
45
50
|
|
|
46
51
|
export default (() =>
|
|
47
52
|
{
|
|
@@ -64,6 +69,11 @@ export default (() =>
|
|
|
64
69
|
|
|
65
70
|
const selector = Object.keys(componentMap).join(',');
|
|
66
71
|
|
|
72
|
+
const findEntry = (element: HTMLElement): ComponentEntry<HTMLElement> | undefined =>
|
|
73
|
+
Object.entries(componentMap)
|
|
74
|
+
.find(([selector, { type }]) => element.matches(selector) && element instanceof type)
|
|
75
|
+
?.[1];
|
|
76
|
+
|
|
67
77
|
const initializeScrollbars = (): void =>
|
|
68
78
|
{
|
|
69
79
|
document.documentElement.style.setProperty(
|
|
@@ -74,36 +84,51 @@ export default (() =>
|
|
|
74
84
|
|
|
75
85
|
const initializeComponent = (element: HTMLElement): void =>
|
|
76
86
|
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
&& element instanceof type
|
|
81
|
-
&& typeof component.initialize === 'function'
|
|
82
|
-
) {
|
|
83
|
-
component.initialize(element);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
87
|
+
const entry = findEntry(element);
|
|
88
|
+
if (entry && typeof entry.component.initialize === 'function') {
|
|
89
|
+
entry.component.initialize(element);
|
|
86
90
|
}
|
|
87
91
|
};
|
|
88
92
|
|
|
93
|
+
const rippleInitialized = new WeakSet<HTMLElement>();
|
|
94
|
+
|
|
89
95
|
const initializeComponents = (parent: HTMLDocument | HTMLElement): void =>
|
|
90
96
|
{
|
|
91
97
|
parent.querySelectorAll<HTMLElement>(selector).forEach(initializeComponent);
|
|
92
|
-
|
|
93
|
-
parent.querySelectorAll<HTMLElement>('[class*="micl-"]').forEach(element =>
|
|
98
|
+
parent.querySelectorAll<HTMLElement>('[class*="micl-"], [class*="micl-"] > summary').forEach(element =>
|
|
94
99
|
{
|
|
100
|
+
if (rippleInitialized.has(element)) return;
|
|
101
|
+
|
|
95
102
|
if (window.getComputedStyle(element).getPropertyValue('--micl-ripple') === '1') {
|
|
96
|
-
element.addEventListener('pointerdown', e =>
|
|
103
|
+
element.addEventListener('pointerdown', (e: PointerEvent) =>
|
|
97
104
|
{
|
|
98
105
|
if ((e.currentTarget as Element).classList.contains('micl-card--nonactionable')) {
|
|
99
106
|
return;
|
|
100
107
|
}
|
|
101
108
|
e.stopPropagation();
|
|
102
109
|
|
|
103
|
-
|
|
110
|
+
const r = element.getBoundingClientRect();
|
|
104
111
|
element.style.setProperty('--micl-x', `${e.clientX - r.left}px`);
|
|
105
112
|
element.style.setProperty('--micl-y', `${e.clientY - r.top}px`);
|
|
113
|
+
|
|
114
|
+
element.classList.remove('micl-rippling');
|
|
115
|
+
void element.offsetWidth;
|
|
116
|
+
element.classList.add('micl-rippling');
|
|
117
|
+
|
|
118
|
+
const cleanup = (ev: AnimationEvent): void =>
|
|
119
|
+
{
|
|
120
|
+
if (ev.animationName !== 'micl-ripple') return;
|
|
121
|
+
|
|
122
|
+
element.classList.remove('micl-rippling');
|
|
123
|
+
element.style.removeProperty('--micl-x');
|
|
124
|
+
element.style.removeProperty('--micl-y');
|
|
125
|
+
element.removeEventListener('animationend', cleanup);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
element.addEventListener('animationend', cleanup);
|
|
106
129
|
});
|
|
130
|
+
|
|
131
|
+
rippleInitialized.add(element);
|
|
107
132
|
}
|
|
108
133
|
});
|
|
109
134
|
|
|
@@ -112,15 +137,9 @@ export default (() =>
|
|
|
112
137
|
|
|
113
138
|
const cleanupComponent = (element: HTMLElement): void =>
|
|
114
139
|
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
&& element instanceof type
|
|
119
|
-
&& typeof component.cleanup === 'function'
|
|
120
|
-
) {
|
|
121
|
-
component.cleanup(element);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
140
|
+
const entry = findEntry(element);
|
|
141
|
+
if (entry && typeof entry.component.cleanup === 'function') {
|
|
142
|
+
entry.component.cleanup(element);
|
|
124
143
|
}
|
|
125
144
|
};
|
|
126
145
|
|
|
@@ -131,14 +150,13 @@ export default (() =>
|
|
|
131
150
|
|
|
132
151
|
const handleEvent = (event: Event): void =>
|
|
133
152
|
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
153
|
+
const target = (event.target as Element).closest(selector);
|
|
154
|
+
if (!(target instanceof HTMLElement)) return;
|
|
155
|
+
|
|
156
|
+
const entry = findEntry(target);
|
|
157
|
+
const key = event.type as EventHandlerKey;
|
|
158
|
+
if (entry && typeof entry.component[key] === 'function') {
|
|
159
|
+
entry.component[key]?.(event);
|
|
142
160
|
}
|
|
143
161
|
};
|
|
144
162
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "material-inspired-component-library",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "The Material-Inspired Component Library (MICL) offers a collection of beautifully crafted components leveraging native HTML markup, designed to align with the Material Design 3 guidelines.",
|
|
5
5
|
"author": "MICL Hermana <micl.hermana@proton.me> (https://github.com/henkpb/micl)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"sideEffects": false,
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"autoprefixer": "^10.
|
|
57
|
+
"autoprefixer": "^10.5",
|
|
58
58
|
"css-loader": "^7.1",
|
|
59
59
|
"extract-loader": "^5.1",
|
|
60
60
|
"file-loader": "^6.2",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"sass-loader": "^16.0",
|
|
66
66
|
"ts-loader": "^9.5",
|
|
67
67
|
"typescript": "^6.0",
|
|
68
|
-
"webpack": "^5.
|
|
68
|
+
"webpack": "^5.106",
|
|
69
69
|
"webpack-cli": "^7.0"
|
|
70
70
|
}
|
|
71
71
|
}
|
package/styles/README.md
CHANGED
|
@@ -23,7 +23,7 @@ You can customize elevation levels by overriding their global CSS variables.
|
|
|
23
23
|
</div>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
## Motion
|
|
28
28
|
Motion brings your UI to life, making it expressive and intuitive to use. The motion styles are based on the [Material Design 3 Motion](https://m3.material.io/styles/motion/overview/how-it-works) guidelines.
|
|
29
29
|
|
|
@@ -34,7 +34,7 @@ Import the motion styles into your project:
|
|
|
34
34
|
@use "material-inspired-component-library/styles/motion";
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
## Shapes
|
|
39
39
|
Shapes add decorative flair and help emphasize elements. These styles adhere to the [Material Design 3 Shape](https://m3.material.io/styles/shape/overview-principles) principles.
|
|
40
40
|
|
|
@@ -57,7 +57,7 @@ You can customize a component's shape by overriding its global CSS variables, su
|
|
|
57
57
|
</div>
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
## State layers
|
|
62
62
|
State layers are visual overlays that communicate the interaction status of a component, such as when it's hovered over or pressed. These are based on [Material Design 3 States](https://m3.material.io/foundations/interaction/states/overview).
|
|
63
63
|
|
|
@@ -78,7 +78,7 @@ Customize the appearance of state layers by overriding their global CSS variable
|
|
|
78
78
|
</div>
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
|
|
82
82
|
## Typography
|
|
83
83
|
Typography is the foundation of text styling. The typography styles in this library are based on the [Material Design 3 Typography](https://m3.material.io/styles/typography/overview) specifications.
|
|
84
84
|
|
|
@@ -106,3 +106,13 @@ And include a reference to the font in your application.
|
|
|
106
106
|
```HTML
|
|
107
107
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap">
|
|
108
108
|
```
|
|
109
|
+
|
|
110
|
+
**Font width and letter spacing**
|
|
111
|
+
|
|
112
|
+
The default typography styles apply natural letter spacing (`0px` or `normal`) optimized for the default MICL font, [**Google Sans**](https://fonts.google.com/specimen/Google+Sans). If you opt to use a narrower geometric font, such as [**Roboto**](https://fonts.google.com/specimen/Roboto), you can enable positive letter spacing to improve legibility at smaller sizes. To do this, set the `--md-ref-typeface-plain-narrow` variable to `1` in your root stylesheet:
|
|
113
|
+
|
|
114
|
+
```CSS
|
|
115
|
+
:root {
|
|
116
|
+
--md-ref-typeface-plain-narrow: 1;
|
|
117
|
+
}
|
|
118
|
+
```
|
package/styles/shapes.scss
CHANGED
|
@@ -47,3 +47,84 @@ $md-sys-shape-corner-full: 50%;
|
|
|
47
47
|
--md-sys-shape-corner-extra-extra-large: #{$md-sys-shape-corner-value-extra-extra-large};
|
|
48
48
|
--md-sys-shape-corner-full: #{$md-sys-shape-corner-full};
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
.micl-shape--no-rounding {
|
|
53
|
+
border-radius: var(--md-sys-shape-corner-none, 0px);
|
|
54
|
+
}
|
|
55
|
+
.micl-shape--extra-small-rounding {
|
|
56
|
+
border-radius: var(--md-sys-shape-corner-extra-small, 4px);
|
|
57
|
+
}
|
|
58
|
+
.micl-shape--extra-small-top-rounding {
|
|
59
|
+
border-radius: var(--md-sys-shape-corner-extra-small-top, 4px) var(--md-sys-shape-corner-extra-small-top, 4px) 0 0;
|
|
60
|
+
}
|
|
61
|
+
.micl-shape--small-rounding {
|
|
62
|
+
border-radius: var(--md-sys-shape-corner-small, 8px);
|
|
63
|
+
}
|
|
64
|
+
.micl-shape--medium-rounding {
|
|
65
|
+
border-radius: var(--md-sys-shape-corner-medium, 12px);
|
|
66
|
+
}
|
|
67
|
+
.micl-shape--large-rounding {
|
|
68
|
+
border-radius: var(--md-sys-shape-corner-large, 16px);
|
|
69
|
+
}
|
|
70
|
+
.micl-shape--large-top-rounding {
|
|
71
|
+
border-radius: var(--md-sys-shape-corner-large, 16px) var(--md-sys-shape-corner-large, 16px) 0 0;
|
|
72
|
+
}
|
|
73
|
+
.micl-shape--large-start-rounding {
|
|
74
|
+
border-start-start-radius: var(--md-sys-shape-corner-large, 16px);
|
|
75
|
+
border-start-end-radius: 0;
|
|
76
|
+
border-end-start-radius: var(--md-sys-shape-corner-large, 16px);
|
|
77
|
+
border-end-end-radius: 0;
|
|
78
|
+
}
|
|
79
|
+
.micl-shape--large-end-rounding {
|
|
80
|
+
border-start-start-radius: 0;
|
|
81
|
+
border-start-end-radius: var(--md-sys-shape-corner-large, 16px);
|
|
82
|
+
border-end-start-radius: 0;
|
|
83
|
+
border-end-end-radius: var(--md-sys-shape-corner-large, 16px);
|
|
84
|
+
}
|
|
85
|
+
.micl-shape--large-increased-rounding {
|
|
86
|
+
border-radius: var(--md-sys-shape-corner-large-increased, 20px);
|
|
87
|
+
}
|
|
88
|
+
.micl-shape--extra-large-rounding {
|
|
89
|
+
border-radius: var(--md-sys-shape-corner-extra-large, 28px);
|
|
90
|
+
}
|
|
91
|
+
.micl-shape--extra-large-top-rounding {
|
|
92
|
+
border-radius: var(--md-sys-shape-corner-extra-large, 28px) var(--md-sys-shape-corner-extra-large, 28px) 0 0;
|
|
93
|
+
}
|
|
94
|
+
.micl-shape--extra-large-increased-rounding {
|
|
95
|
+
border-radius: var(--md-sys-shape-corner-extra-large-increased, 32px);
|
|
96
|
+
}
|
|
97
|
+
.micl-shape--extra-extra-large-rounding {
|
|
98
|
+
border-radius: var(--md-sys-shape-corner-extra-extra-large, 48px);
|
|
99
|
+
}
|
|
100
|
+
.micl-shape--full-rounding {
|
|
101
|
+
border-radius: var(--md-sys-shape-corner-full, 50%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
.micl-shape-circle {
|
|
106
|
+
border-radius: var(--md-sys-shape-corner-full, 50%);
|
|
107
|
+
background-color: var(--micl-shape-background-color);
|
|
108
|
+
}
|
|
109
|
+
.micl-shape-square {
|
|
110
|
+
background-color: var(--micl-shape-background-color);
|
|
111
|
+
}
|
|
112
|
+
.micl-shape-slanted {
|
|
113
|
+
position: relative;
|
|
114
|
+
z-index: 1;
|
|
115
|
+
}
|
|
116
|
+
.micl-shape-slanted::before {
|
|
117
|
+
content: "";
|
|
118
|
+
position: absolute;
|
|
119
|
+
inset: 0;
|
|
120
|
+
border-radius: inherit;
|
|
121
|
+
z-index: -1;
|
|
122
|
+
background-color: var(--micl-shape-background-color);
|
|
123
|
+
transform: skewX(-8deg);
|
|
124
|
+
}
|
|
125
|
+
.micl-shape-arch {
|
|
126
|
+
border-start-start-radius: 50% !important;
|
|
127
|
+
border-start-end-radius: 50% !important;
|
|
128
|
+
background-color: var(--micl-shape-background-color);
|
|
129
|
+
}
|
|
130
|
+
*/
|
package/styles/statelayer.scss
CHANGED
|
@@ -33,6 +33,8 @@ $md-sys-state-focus-indicator-inner-offset: -3px;
|
|
|
33
33
|
$md-sys-state-focus-indicator-outer-offset: 2px;
|
|
34
34
|
$md-sys-state-focus-indicator-thickness: 3px;
|
|
35
35
|
|
|
36
|
+
$md-sys-state-ripple-duration: 5000ms;
|
|
37
|
+
|
|
36
38
|
:root {
|
|
37
39
|
--md-sys-state-layer-size: #{$md-sys-state-layer-size};
|
|
38
40
|
--md-sys-target-size: #{$md-sys-target-size};
|
|
@@ -47,6 +49,9 @@ $md-sys-state-focus-indicator-thickness: 3px;
|
|
|
47
49
|
--md-sys-state-focus-indicator-inner-offset: #{$md-sys-state-focus-indicator-inner-offset};
|
|
48
50
|
--md-sys-state-focus-indicator-outer-offset: #{$md-sys-state-focus-indicator-outer-offset};
|
|
49
51
|
--md-sys-state-focus-indicator-thickness: #{$md-sys-state-focus-indicator-thickness};
|
|
52
|
+
|
|
53
|
+
--md-sys-state-ripple-opacity-factor: 0.6;
|
|
54
|
+
--md-sys-state-ripple-duration: #{$md-sys-state-ripple-duration};
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
@property --statelayer-color {
|
|
@@ -60,3 +65,8 @@ $md-sys-state-focus-indicator-thickness: 3px;
|
|
|
60
65
|
initial-value: 0%;
|
|
61
66
|
inherits: false;
|
|
62
67
|
}
|
|
68
|
+
|
|
69
|
+
@keyframes micl-ripple {
|
|
70
|
+
from { background-size: 0%, 100%; }
|
|
71
|
+
to { background-size: 10000%, 100%; }
|
|
72
|
+
}
|
package/styles/typography.scss
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
:root {
|
|
23
23
|
--md-ref-typeface-plain: Google Sans, system-ui, sans-serif;
|
|
24
|
+
--md-ref-typeface-plain-narrow: 0;
|
|
24
25
|
--md-ref-typeface-brand: Google Sans, system-ui, sans-serif;
|
|
25
26
|
--md-ref-typeface-weight-regular: 400;
|
|
26
27
|
--md-ref-typeface-weight-medium: 500;
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
--md-sys-typescale-title-medium-size: 1rem; // 16px
|
|
73
74
|
--md-sys-typescale-title-medium-line-height: 1.5rem; // 24px
|
|
74
75
|
--md-sys-typescale-title-medium-weight: var(--md-ref-typeface-weight-medium);
|
|
75
|
-
--md-sys-typescale-title-medium-tracking: 0
|
|
76
|
+
--md-sys-typescale-title-medium-tracking: 0.009375rem; // ~0.15px letter-spacing
|
|
76
77
|
|
|
77
78
|
--md-sys-typescale-title-small-font: var(--md-ref-typeface-plain);
|
|
78
79
|
--md-sys-typescale-title-small-size: 0.875rem; // 14px
|
|
@@ -92,6 +93,12 @@
|
|
|
92
93
|
--md-sys-typescale-body-medium-weight: var(--md-ref-typeface-weight-regular);
|
|
93
94
|
--md-sys-typescale-body-medium-tracking: 0.015625rem; // ~0.25px letter-spacing
|
|
94
95
|
|
|
96
|
+
--md-sys-typescale-body-smallmedium-font: var(--md-ref-typeface-plain);
|
|
97
|
+
--md-sys-typescale-body-smallmedium-size: 0.8125rem; // 13px
|
|
98
|
+
--md-sys-typescale-body-smallmedium-line-height: 1.125rem; // 18px
|
|
99
|
+
--md-sys-typescale-body-smallmedium-weight: var(--md-ref-typeface-weight-regular);
|
|
100
|
+
--md-sys-typescale-body-smallmedium-tracking: 0.025rem; // ~0.4px letter-spacing
|
|
101
|
+
|
|
95
102
|
--md-sys-typescale-body-small-font: var(--md-ref-typeface-plain);
|
|
96
103
|
--md-sys-typescale-body-small-size: 0.75rem; // 12px
|
|
97
104
|
--md-sys-typescale-body-small-line-height: 1rem; // 16px
|
|
@@ -162,7 +169,7 @@
|
|
|
162
169
|
--md-sys-typescale-emphasized-title-medium-size: 1rem; // 16px
|
|
163
170
|
--md-sys-typescale-emphasized-title-medium-line-height: 1.5rem; // 24px
|
|
164
171
|
--md-sys-typescale-emphasized-title-medium-weight: var(--md-ref-typeface-weight-bold);
|
|
165
|
-
--md-sys-typescale-emphasized-title-medium-tracking: 0
|
|
172
|
+
--md-sys-typescale-emphasized-title-medium-tracking: 0.009375rem; // ~0.15px letter-spacing
|
|
166
173
|
|
|
167
174
|
--md-sys-typescale-emphasized-title-small-font: var(--md-ref-typeface-plain);
|
|
168
175
|
--md-sys-typescale-emphasized-title-small-size: 0.875rem; // 14px
|
|
@@ -206,6 +213,27 @@
|
|
|
206
213
|
--md-sys-typescale-emphasized-label-small-weight: var(--md-ref-typeface-weight-bold);
|
|
207
214
|
--md-sys-typescale-emphasized-label-small-tracking: 0.03125rem; // ~0.5px letter-spacing
|
|
208
215
|
}
|
|
216
|
+
@supports (letter-spacing: if(style(--md-ref-typeface-plain-narrow: 1): 0; else: 0)) {
|
|
217
|
+
:root {
|
|
218
|
+
--md-sys-typescale-title-medium-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.009375rem; else: 0px);
|
|
219
|
+
--md-sys-typescale-title-small-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.00625rem; else: 0px);
|
|
220
|
+
--md-sys-typescale-body-large-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.03125rem; else: 0px);
|
|
221
|
+
--md-sys-typescale-body-medium-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.015625rem; else: 0px);
|
|
222
|
+
--md-sys-typescale-body-smallmedium-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.025rem; else: 0px);
|
|
223
|
+
--md-sys-typescale-body-small-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.025rem; else: 0px);
|
|
224
|
+
--md-sys-typescale-label-large-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.00625rem; else: 0px);
|
|
225
|
+
--md-sys-typescale-label-medium-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.03125rem; else: 0px);
|
|
226
|
+
--md-sys-typescale-label-small-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.03125rem; else: 0px);
|
|
227
|
+
--md-sys-typescale-emphasized-title-medium-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.009375rem; else: 0px);
|
|
228
|
+
--md-sys-typescale-emphasized-title-small-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.00625rem; else: 0px);
|
|
229
|
+
--md-sys-typescale-emphasized-body-large-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.03125rem; else: 0px);
|
|
230
|
+
--md-sys-typescale-emphasized-body-medium-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.015625rem; else: 0px);
|
|
231
|
+
--md-sys-typescale-emphasized-body-small-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.025rem; else: 0px);
|
|
232
|
+
--md-sys-typescale-emphasized-label-large-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.00625rem; else: 0px);
|
|
233
|
+
--md-sys-typescale-emphasized-label-medium-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.03125rem; else: 0px);
|
|
234
|
+
--md-sys-typescale-emphasized-label-small-tracking: if(style(--md-ref-typeface-plain-narrow: 1): 0.03125rem; else: 0px);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
209
237
|
|
|
210
238
|
@mixin display-large {
|
|
211
239
|
font-family: var(--md-sys-typescale-display-large-font);
|
|
@@ -295,6 +323,14 @@
|
|
|
295
323
|
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
296
324
|
}
|
|
297
325
|
|
|
326
|
+
@mixin body-smallmedium {
|
|
327
|
+
font-family: var(--md-sys-typescale-body-smallmedium-font);
|
|
328
|
+
font-size: var(--md-sys-typescale-body-smallmedium-size);
|
|
329
|
+
line-height: var(--md-sys-typescale-body-smallmedium-line-height);
|
|
330
|
+
font-weight: var(--md-sys-typescale-body-smallmedium-weight);
|
|
331
|
+
letter-spacing: var(--md-sys-typescale-body-smallmedium-tracking);
|
|
332
|
+
}
|
|
333
|
+
|
|
298
334
|
@mixin body-small {
|
|
299
335
|
font-family: var(--md-sys-typescale-body-small-font);
|
|
300
336
|
font-size: var(--md-sys-typescale-body-small-size);
|
package/tsconfig.json
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
54
54
|
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
55
55
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
56
|
-
|
|
56
|
+
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
57
57
|
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
58
58
|
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
59
59
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
93
93
|
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
94
94
|
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
96
|
+
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
97
97
|
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
98
|
-
|
|
98
|
+
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
99
99
|
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
100
100
|
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
101
101
|
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|