@shortfuse/materialdesignweb 0.2.0 → 0.5.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/.browserslistrc +2 -1
- package/.eslintrc.json +188 -30
- package/.stylelintrc.json +643 -2
- package/.vscode/launch.json +20 -5
- package/.vscode/settings.json +3 -0
- package/CHANGELOG.md +36 -0
- package/README.md +82 -2
- package/adapters/datatable/column.js +176 -0
- package/adapters/datatable/index.js +253 -437
- package/adapters/dom/index.js +586 -0
- package/adapters/list/index.js +36 -113
- package/adapters/search/index.js +153 -180
- package/components/appbar/_spec.scss +165 -0
- package/components/appbar/_theme.scss +0 -0
- package/components/appbar/index.scss +2 -0
- package/components/banner/_spec.scss +83 -0
- package/components/banner/_theme.scss +0 -0
- package/components/banner/index.scss +2 -0
- package/components/bottomnav/README.md +4 -4
- package/components/bottomnav/_spec.scss +149 -0
- package/components/bottomnav/_theme.scss +0 -0
- package/components/bottomnav/index.js +100 -120
- package/components/bottomnav/index.scss +2 -0
- package/components/bottomnav/item.js +88 -0
- package/components/button/README.md +16 -22
- package/components/button/_spec.scss +162 -0
- package/components/button/_theme.scss +42 -0
- package/components/button/index.eta +32 -0
- package/components/button/index.js +37 -48
- package/components/button/index.pug +18 -0
- package/components/button/index.scss +2 -0
- package/components/card/_spec.scss +241 -0
- package/components/card/_theme.scss +0 -0
- package/components/card/index.scss +2 -0
- package/components/chip/_spec.scss +111 -0
- package/components/chip/_theme.scss +105 -0
- package/components/chip/index.js +23 -0
- package/components/chip/index.scss +2 -0
- package/components/chip/item.js +20 -0
- package/components/datatable/_spec.scss +225 -0
- package/components/datatable/_theme.scss +128 -0
- package/components/datatable/cell.js +44 -0
- package/components/datatable/columnheader.js +46 -0
- package/components/datatable/index.js +339 -443
- package/components/datatable/index.scss +2 -0
- package/components/datatable/row.js +48 -0
- package/components/datatable/rowheader.js +18 -0
- package/components/dialog/_spec.scss +203 -0
- package/components/dialog/_theme.scss +7 -0
- package/components/dialog/index.js +512 -437
- package/components/dialog/index.scss +2 -0
- package/components/divider/_spec.scss +11 -0
- package/components/divider/_theme.scss +0 -0
- package/components/divider/index.scss +2 -0
- package/components/elevation/_spec.scss +9 -0
- package/components/elevation/_theme.scss +0 -0
- package/components/elevation/index.scss +2 -0
- package/components/fab/{style.scss → _spec.scss} +104 -79
- package/components/fab/_theme.scss +0 -0
- package/components/fab/index.js +85 -79
- package/components/fab/index.scss +2 -0
- package/components/grid/_spec.scss +169 -0
- package/components/grid/_theme.scss +0 -0
- package/components/grid/index.scss +2 -0
- package/components/layout/_mixins.scss +11 -0
- package/components/layout/_spec.scss +916 -0
- package/components/layout/_theme.scss +19 -0
- package/components/layout/index.js +454 -0
- package/components/layout/index.scss +2 -0
- package/components/list/_spec.scss +363 -0
- package/components/list/_theme.scss +102 -0
- package/components/list/content.js +106 -0
- package/components/list/index.js +234 -79
- package/components/list/index.scss +2 -0
- package/components/list/item.js +167 -0
- package/components/list/secondary.js +45 -0
- package/components/menu/_spec.scss +329 -0
- package/components/menu/_theme.scss +0 -0
- package/components/menu/index.js +636 -651
- package/components/menu/index.scss +2 -0
- package/components/menu/item.js +231 -0
- package/components/progress/_spec.scss +156 -0
- package/components/progress/_theme.scss +0 -0
- package/components/progress/index.js +29 -13
- package/components/progress/index.scss +2 -0
- package/components/selection/_spec.scss +376 -0
- package/components/selection/_theme.scss +134 -0
- package/components/selection/index.eta +60 -0
- package/components/selection/index.js +70 -0
- package/components/selection/index.pug +30 -0
- package/components/selection/index.scss +2 -0
- package/components/selection/input.js +54 -0
- package/components/selection/radiogroup.js +40 -0
- package/components/slider/{style.scss → _spec.scss} +31 -34
- package/components/slider/_theme.scss +0 -0
- package/components/slider/index.scss +2 -0
- package/components/snackbar/_spec.scss +150 -0
- package/components/snackbar/_theme.scss +0 -0
- package/components/snackbar/index.js +293 -206
- package/components/snackbar/index.scss +2 -0
- package/components/tab/_spec.scss +220 -0
- package/components/tab/_theme.scss +0 -0
- package/components/tab/content.js +210 -0
- package/components/tab/index.js +229 -213
- package/components/tab/index.scss +2 -0
- package/components/tab/item.js +88 -0
- package/components/tab/list.js +196 -0
- package/components/tab/panel.js +54 -0
- package/components/textfield/README.md +4 -4
- package/components/textfield/_spec.scss +763 -0
- package/components/textfield/_theme.scss +264 -0
- package/components/textfield/index.eta +74 -0
- package/components/textfield/index.js +132 -138
- package/components/textfield/index.pug +30 -0
- package/components/textfield/index.scss +2 -0
- package/components/tooltip/_spec.scss +185 -0
- package/components/tooltip/_theme.scss +0 -0
- package/components/tooltip/index.scss +2 -0
- package/components/type/_spec.scss +227 -0
- package/components/type/_theme.scss +0 -0
- package/components/type/index.scss +2 -0
- package/core/_breakpoint.scss +189 -0
- package/core/_elevation.scss +78 -0
- package/core/_length.scss +8 -0
- package/core/_motion.scss +31 -0
- package/core/_platform.scss +12 -0
- package/core/_type.scss +128 -0
- package/core/aria/attributes.js +141 -0
- package/core/aria/button.js +49 -0
- package/core/aria/keyboard.js +92 -0
- package/core/aria/rovingtabindex.js +175 -0
- package/core/aria/tab.js +59 -0
- package/core/document/index.js +39 -0
- package/core/dom.js +180 -0
- package/core/overlay/_spec.scss +28 -0
- package/core/overlay/_theme.scss +147 -0
- package/core/overlay/index.js +95 -0
- package/core/overlay/index.scss +2 -0
- package/core/ripple/_spec.scss +196 -0
- package/core/ripple/_theme.scss +20 -0
- package/core/ripple/index.js +286 -0
- package/core/ripple/index.scss +2 -0
- package/core/theme/_aliases.scss +15 -0
- package/core/theme/_config.scss +8 -0
- package/core/theme/_functions.scss +22 -0
- package/{components/theming/palettes.scss → core/theme/_palettes.scss} +173 -151
- package/core/theme/_spec.scss +0 -0
- package/core/theme/_theme.scss +268 -0
- package/core/theme/index.js +50 -0
- package/core/theme/index.scss +4 -0
- package/core/throttler.js +42 -0
- package/core/transition/index.js +465 -0
- package/docs/_flex.scss +28 -0
- package/docs/_menuoptions.js +183 -0
- package/docs/_partials/_androidnavbar.eta +5 -0
- package/docs/_partials/_androidstatusbar.eta +13 -0
- package/docs/_partials/_appbar.eta +27 -0
- package/docs/_partials/_buttontest.eta +31 -0
- package/docs/_partials/_header.eta +146 -0
- package/docs/_partials/_navlistitem.eta +16 -0
- package/docs/_partials/_target.eta +1 -0
- package/docs/_sample-utils.js +88 -0
- package/docs/{src/storage.js → _storage.js} +0 -0
- package/docs/docs.scss +331 -0
- package/docs/framework.scss +26 -0
- package/docs/index.eta +12 -0
- package/docs/index.js +7 -0
- package/docs/pages/appbar.eta +108 -0
- package/docs/pages/appbar.js +0 -0
- package/docs/pages/bottomnav.eta +188 -0
- package/docs/pages/bottomnav.js +118 -0
- package/docs/pages/button.eta +124 -0
- package/docs/pages/button.js +224 -0
- package/docs/pages/card.eta +90 -0
- package/docs/pages/card.js +175 -0
- package/docs/pages/chip.eta +122 -0
- package/docs/pages/chip.js +80 -0
- package/docs/pages/color.eta +143 -0
- package/docs/pages/color.js +261 -0
- package/docs/pages/datatable.eta +323 -0
- package/docs/pages/datatable.js +160 -0
- package/docs/pages/dialog.eta +184 -0
- package/docs/{src/components → pages}/dialog.js +35 -48
- package/docs/pages/dom.eta +26 -0
- package/docs/pages/dom.js +140 -0
- package/docs/pages/elevation.eta +35 -0
- package/docs/pages/elevation.js +0 -0
- package/docs/pages/fab.eta +99 -0
- package/docs/{src/components → pages}/fab.js +6 -13
- package/docs/pages/grid.eta +135 -0
- package/docs/pages/grid.js +128 -0
- package/docs/pages/layout.eta +8 -0
- package/docs/pages/layout.js +0 -0
- package/docs/pages/list.eta +465 -0
- package/docs/pages/list.js +8 -0
- package/docs/pages/menu.eta +274 -0
- package/docs/{src/components → pages}/menu.js +26 -42
- package/docs/pages/overlay.eta +69 -0
- package/docs/pages/overlay.js +3 -0
- package/docs/pages/progress.eta +23 -0
- package/docs/{src/components → pages}/progress.js +2 -4
- package/docs/pages/ripple.eta +27 -0
- package/docs/pages/ripple.js +3 -0
- package/docs/pages/search.eta +242 -0
- package/docs/pages/search.js +226 -0
- package/docs/pages/selection.eta +107 -0
- package/docs/pages/selection.js +12 -0
- package/docs/pages/slider.eta +23 -0
- package/docs/pages/slider.js +0 -0
- package/docs/pages/snackbar.eta +83 -0
- package/docs/{src/components → pages}/snackbar.js +31 -36
- package/docs/pages/tab.eta +407 -0
- package/docs/pages/tab.js +152 -0
- package/docs/pages/textfield.eta +487 -0
- package/docs/{src/components → pages}/textfield.js +41 -45
- package/docs/pages/tooltip.eta +92 -0
- package/docs/pages/tooltip.js +0 -0
- package/docs/pages/transition.eta +117 -0
- package/docs/pages/transition.js +52 -0
- package/docs/pages/type.eta +31 -0
- package/docs/pages/type.js +0 -0
- package/docs/postrender.js +41 -0
- package/docs/prerender.js +16 -0
- package/docs/pwa/_dialogs.eta +143 -0
- package/docs/pwa/_menus.eta +16 -0
- package/docs/pwa/pwa-prerender.js +3 -0
- package/docs/pwa/pwa.eta +478 -0
- package/docs/pwa/pwa.js +298 -0
- package/docs/pwa/pwa.scss +31 -0
- package/docs/themes/theme-colored.scss +15 -0
- package/docs/themes/theme-default.scss +3 -0
- package/index.scss +27 -0
- package/jsconfig.json +8 -2
- package/package.json +54 -27
- package/scripts/deploy-docs.sh +9 -0
- package/templates/index.eta +2 -0
- package/templates/index.pug +3 -0
- package/tsconfig.json +16 -0
- package/utils/function.js +3 -0
- package/webpack.config.js +224 -68
- package/_index.scss +0 -4
- package/components/all-components.scss +0 -21
- package/components/bottomnav/style.scss +0 -190
- package/components/bottomnav/theming.scss +0 -76
- package/components/button/style.scss +0 -315
- package/components/button/theming.scss +0 -134
- package/components/card/style.scss +0 -175
- package/components/card/theming.scss +0 -43
- package/components/common/dom.js +0 -51
- package/components/common/functions.scss +0 -174
- package/components/common/mixins.scss +0 -122
- package/components/common/motion.scss +0 -36
- package/components/common/type.scss +0 -104
- package/components/common/variables.scss +0 -46
- package/components/datatable/style.scss +0 -257
- package/components/datatable/theming.scss +0 -119
- package/components/dialog/style.scss +0 -159
- package/components/dialog/theming.scss +0 -29
- package/components/divider/style.scss +0 -7
- package/components/divider/theming.scss +0 -20
- package/components/elevation/style.scss +0 -32
- package/components/layout/style.scss +0 -223
- package/components/list/style.scss +0 -358
- package/components/list/theming.scss +0 -83
- package/components/menu/style.scss +0 -280
- package/components/menu/theming.scss +0 -80
- package/components/navdrawer/index.js +0 -200
- package/components/navdrawer/style.scss +0 -595
- package/components/navdrawer/theming.scss +0 -62
- package/components/progress/style.scss +0 -136
- package/components/ripple/index.js +0 -63
- package/components/ripple/ripple.scss +0 -122
- package/components/selection/style.scss +0 -320
- package/components/selection/theming.scss +0 -98
- package/components/snackbar/style.scss +0 -212
- package/components/switch/style.scss +0 -3
- package/components/tab/style.scss +0 -275
- package/components/tab/theming.scss +0 -34
- package/components/template/theming.scss +0 -31
- package/components/textfield/style.scss +0 -795
- package/components/textfield/theming.scss +0 -256
- package/components/theming/globals.scss +0 -25
- package/components/theming/theming.scss +0 -559
- package/components/toolbar/style.scss +0 -190
- package/components/toolbar/theming.scss +0 -32
- package/components/tooltip/style.scss +0 -135
- package/components/type/style.scss +0 -167
- package/components/type/theming.scss +0 -25
- package/docs/bottomnav.html +0 -1
- package/docs/bottomnav.min.js +0 -2
- package/docs/bottomnav.min.js.map +0 -1
- package/docs/button.html +0 -1
- package/docs/button.min.js +0 -2
- package/docs/button.min.js.map +0 -1
- package/docs/card.html +0 -1
- package/docs/card.min.js +0 -2
- package/docs/card.min.js.map +0 -1
- package/docs/components.min.css +0 -1
- package/docs/components.min.js +0 -2
- package/docs/components.min.js.map +0 -1
- package/docs/datatable.html +0 -1
- package/docs/datatable.min.js +0 -2
- package/docs/datatable.min.js.map +0 -1
- package/docs/dialog.html +0 -1
- package/docs/dialog.min.js +0 -2
- package/docs/dialog.min.js.map +0 -1
- package/docs/docs.min.css +0 -1
- package/docs/docs.min.js +0 -2
- package/docs/docs.min.js.map +0 -1
- package/docs/elevation.html +0 -1
- package/docs/elevation.min.js +0 -2
- package/docs/elevation.min.js.map +0 -1
- package/docs/fab.html +0 -1
- package/docs/fab.min.js +0 -2
- package/docs/fab.min.js.map +0 -1
- package/docs/index.html +0 -1
- package/docs/index.min.js +0 -2
- package/docs/index.min.js.map +0 -1
- package/docs/layout.html +0 -1
- package/docs/layout.min.js +0 -2
- package/docs/layout.min.js.map +0 -1
- package/docs/list.html +0 -1
- package/docs/list.min.js +0 -2
- package/docs/list.min.js.map +0 -1
- package/docs/menu.html +0 -1
- package/docs/menu.min.js +0 -2
- package/docs/menu.min.js.map +0 -1
- package/docs/navdrawer.html +0 -1
- package/docs/navdrawer.min.js +0 -2
- package/docs/navdrawer.min.js.map +0 -1
- package/docs/prerender.min.js +0 -2
- package/docs/prerender.min.js.map +0 -1
- package/docs/progress.html +0 -1
- package/docs/progress.min.js +0 -2
- package/docs/progress.min.js.map +0 -1
- package/docs/search.html +0 -1
- package/docs/search.min.js +0 -2
- package/docs/search.min.js.map +0 -1
- package/docs/selection.html +0 -1
- package/docs/selection.min.js +0 -2
- package/docs/selection.min.js.map +0 -1
- package/docs/slider.html +0 -1
- package/docs/slider.min.js +0 -2
- package/docs/slider.min.js.map +0 -1
- package/docs/snackbar.html +0 -1
- package/docs/snackbar.min.js +0 -2
- package/docs/snackbar.min.js.map +0 -1
- package/docs/src/components/bottomnav.js +0 -16
- package/docs/src/components/bottomnav.pug +0 -112
- package/docs/src/components/button.js +0 -156
- package/docs/src/components/button.pug +0 -194
- package/docs/src/components/card.js +0 -136
- package/docs/src/components/card.pug +0 -133
- package/docs/src/components/datatable.js +0 -183
- package/docs/src/components/datatable.pug +0 -324
- package/docs/src/components/dialog.pug +0 -138
- package/docs/src/components/elevation.js +0 -3
- package/docs/src/components/elevation.pug +0 -17
- package/docs/src/components/fab.pug +0 -84
- package/docs/src/components/layout.js +0 -116
- package/docs/src/components/layout.pug +0 -104
- package/docs/src/components/list.js +0 -15
- package/docs/src/components/list.pug +0 -293
- package/docs/src/components/menu.pug +0 -292
- package/docs/src/components/navdrawer.js +0 -112
- package/docs/src/components/navdrawer.pug +0 -113
- package/docs/src/components/progress.pug +0 -17
- package/docs/src/components/search.js +0 -206
- package/docs/src/components/search.pug +0 -149
- package/docs/src/components/selection.js +0 -6
- package/docs/src/components/selection.pug +0 -116
- package/docs/src/components/slider.js +0 -3
- package/docs/src/components/slider.pug +0 -19
- package/docs/src/components/snackbar.pug +0 -145
- package/docs/src/components/tab.js +0 -137
- package/docs/src/components/tab.pug +0 -329
- package/docs/src/components/textfield.pug +0 -416
- package/docs/src/components/toolbar.js +0 -6
- package/docs/src/components/toolbar.pug +0 -86
- package/docs/src/components/tooltip.js +0 -6
- package/docs/src/components/tooltip.pug +0 -76
- package/docs/src/components/type.js +0 -6
- package/docs/src/components/type.pug +0 -34
- package/docs/src/components.scss +0 -1
- package/docs/src/docs.scss +0 -284
- package/docs/src/index.js +0 -3
- package/docs/src/index.pug +0 -6
- package/docs/src/menuoptions.js +0 -136
- package/docs/src/mixins.pug +0 -139
- package/docs/src/prerender.js +0 -26
- package/docs/src/sample-utils.js +0 -108
- package/docs/src/targetHandler.js +0 -50
- package/docs/src/theming.ie11.scss +0 -18
- package/docs/src/theming.scss +0 -18
- package/docs/tab.html +0 -1
- package/docs/tab.min.js +0 -2
- package/docs/tab.min.js.map +0 -1
- package/docs/textfield.html +0 -2
- package/docs/textfield.min.js +0 -2
- package/docs/textfield.min.js.map +0 -1
- package/docs/theming.ie11.min.css +0 -1
- package/docs/theming.ie11.min.js +0 -2
- package/docs/theming.ie11.min.js.map +0 -1
- package/docs/theming.min.css +0 -1
- package/docs/theming.min.js +0 -2
- package/docs/theming.min.js.map +0 -1
- package/docs/toolbar.html +0 -1
- package/docs/toolbar.min.js +0 -2
- package/docs/toolbar.min.js.map +0 -1
- package/docs/tooltip.html +0 -1
- package/docs/tooltip.min.js +0 -2
- package/docs/tooltip.min.js.map +0 -1
- package/docs/type.html +0 -1
- package/docs/type.min.js +0 -2
- package/docs/type.min.js.map +0 -1
- package/index.js +0 -16
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
@import '../theming/palettes';
|
|
2
|
-
|
|
3
|
-
@function sp($multiplier) {
|
|
4
|
-
@return ($multiplier/16.0) * 1rem;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@function dp($multiplier) {
|
|
8
|
-
@return $multiplier * 1px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@function elevation($dp) {
|
|
12
|
-
@return unquote(map-get($drop-shadow-values, $dp));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@function parseThemeItem($item, $type, $theme: null) {
|
|
16
|
-
$length: length($item);
|
|
17
|
-
@if ($length == 1) {
|
|
18
|
-
@return $item;
|
|
19
|
-
} @else if ($length == 2) {
|
|
20
|
-
@return rgba(nth($item, 1), nth($item, 2));
|
|
21
|
-
} @else {
|
|
22
|
-
$color: nth($item, 1);
|
|
23
|
-
$tone: nth($item, 2);
|
|
24
|
-
$opacity: nth($item, 3);
|
|
25
|
-
@return unquote("rgba(#{getThemePaletteColor($color, $tone, $type, $theme)}, #{$opacity})");
|
|
26
|
-
}
|
|
27
|
-
@return null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@function getThemeMapItem($colorMap, $key, $type) {
|
|
31
|
-
$list: map-get($colorMap, $key);
|
|
32
|
-
$length: length($list);
|
|
33
|
-
@if ($type == 'dark-background') {
|
|
34
|
-
@if ($length >= $dark-background) {
|
|
35
|
-
@return nth($list, $dark-background);
|
|
36
|
-
}
|
|
37
|
-
$type: 'dark';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@if ($type == 'dark') {
|
|
41
|
-
@if ($length >= $dark) {
|
|
42
|
-
@return nth($list, $dark);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
@return nth($list, $light);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@function themeValue($component, $colorMap, $key, $type, $theme: null) {
|
|
49
|
-
@if ($type == 'var') {
|
|
50
|
-
@return var(--#{$component}__#{$key});
|
|
51
|
-
}
|
|
52
|
-
$item: getThemeMapItem($colorMap, $key, $type);
|
|
53
|
-
@return parseThemeItem($item, $type, $theme);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@function getThemePalette($color, $theme) {
|
|
57
|
-
@if ($color == 'primary') {
|
|
58
|
-
@if ($theme != null) {
|
|
59
|
-
@return map-get($palettes, nth($theme, 1));
|
|
60
|
-
}
|
|
61
|
-
@error 'Missing primary color!';
|
|
62
|
-
} @else if ($color == 'accent') {
|
|
63
|
-
@if (length($theme) > 1) {
|
|
64
|
-
@return map-get($palettes, nth($theme, 2));
|
|
65
|
-
}
|
|
66
|
-
@error 'Missing accent color!';
|
|
67
|
-
} @else if ($color == 'warn') {
|
|
68
|
-
@if (length($theme) > 2) {
|
|
69
|
-
@return map-get($palettes, nth($theme, 3));
|
|
70
|
-
}
|
|
71
|
-
@return map-get($palettes, 'red');
|
|
72
|
-
} @else if ($color == 'background') {
|
|
73
|
-
@if (length($theme) > 3) {
|
|
74
|
-
@return map-get($palettes, nth($theme, 4));
|
|
75
|
-
}
|
|
76
|
-
@return map-get($palettes, 'grey');
|
|
77
|
-
}
|
|
78
|
-
@error "Unrecognized Theme Palette!";
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@function getThemePaletteColor($color, $tone, $type, $theme: null) {
|
|
82
|
-
@if ($type == 'var' or ($type == null and $theme == null)) {
|
|
83
|
-
@if ($tone == null) {
|
|
84
|
-
@return var(--#{$color}-color);
|
|
85
|
-
}
|
|
86
|
-
@return var(--#{$color}-#{$tone}-color);
|
|
87
|
-
}
|
|
88
|
-
@if ($tone == null) {
|
|
89
|
-
$tone: '500';
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
$palette: getThemePalette($color, $theme);
|
|
93
|
-
$value: map-get($palette, $tone);
|
|
94
|
-
$rgbValue: red($value), green($value), blue($value);
|
|
95
|
-
@return $rgbValue;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Replace letters
|
|
99
|
-
@function str-replace($string, $search, $replace: '') {
|
|
100
|
-
$index: str-index($string, $search);
|
|
101
|
-
@if $index {
|
|
102
|
-
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
|
103
|
-
}
|
|
104
|
-
@return $string;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Encode symbols
|
|
108
|
-
@function url-encode($string) {
|
|
109
|
-
$map: (
|
|
110
|
-
"%": "%25",
|
|
111
|
-
"<": "%3C",
|
|
112
|
-
">": "%3E",
|
|
113
|
-
" ": "%20",
|
|
114
|
-
"!": "%21",
|
|
115
|
-
"*": "%2A",
|
|
116
|
-
"'": "%27",
|
|
117
|
-
'"': "%22",
|
|
118
|
-
"(": "%28",
|
|
119
|
-
")": "%29",
|
|
120
|
-
";": "%3B",
|
|
121
|
-
":": "%3A",
|
|
122
|
-
"@": "%40",
|
|
123
|
-
"&": "%26",
|
|
124
|
-
"=": "%3D",
|
|
125
|
-
"+": "%2B",
|
|
126
|
-
"$": "%24",
|
|
127
|
-
",": "%2C",
|
|
128
|
-
"/": "%2F",
|
|
129
|
-
"?": "%3F",
|
|
130
|
-
"#": "%23",
|
|
131
|
-
"[": "%5B",
|
|
132
|
-
"]": "%5D"
|
|
133
|
-
);
|
|
134
|
-
$new: $string;
|
|
135
|
-
@each $search, $replace in $map {
|
|
136
|
-
$new: str-replace($new, $search, $replace);
|
|
137
|
-
}
|
|
138
|
-
@return $new;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Format the SVG as a URL
|
|
142
|
-
@function inline-svg($string) {
|
|
143
|
-
@return url('data:image/svg+xml,#{url-encode($string)}');
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// https://material.io/guidelines/resources/shadows.html
|
|
147
|
-
// from Sketch
|
|
148
|
-
$drop-shadow-values: (
|
|
149
|
-
0: "none",
|
|
150
|
-
1: "0 00px 02px 0px rgba(0,0,0,0.14), 0 02px 02px 0px rgba(0,0,0,0.12), 0 01px 03px 0 rgba(0,0,0,0.20)",
|
|
151
|
-
2: "0 00px 04px 0px rgba(0,0,0,0.14), 0 03px 04px 0px rgba(0,0,0,0.12), 0 01px 05px 0 rgba(0,0,0,0.20)",
|
|
152
|
-
3: "0 03px 03px 0px rgba(0,0,0,0.14), 0 03px 04px 0px rgba(0,0,0,0.12), 0 01px 08px 0 rgba(0,0,0,0.20)",
|
|
153
|
-
4: "0 02px 04px 0px rgba(0,0,0,0.14), 0 04px 05px 0px rgba(0,0,0,0.12), 0 01px 10px 0 rgba(0,0,0,0.20)",
|
|
154
|
-
6: "0 06px 10px 0px rgba(0,0,0,0.14), 0 01px 18px 0px rgba(0,0,0,0.12), 0 03px 05px 0 rgba(0,0,0,0.20)",
|
|
155
|
-
8: "0 08px 10px 1px rgba(0,0,0,0.14), 0 03px 14px 3px rgba(0,0,0,0.12), 0 04px 15px 0 rgba(0,0,0,0.20)",
|
|
156
|
-
9: "0 09px 12px 1px rgba(0,0,0,0.14), 0 03px 16px 2px rgba(0,0,0,0.12), 0 05px 06px 0 rgba(0,0,0,0.20)",
|
|
157
|
-
12: "0 12px 17px 2px rgba(0,0,0,0.14), 0 05px 22px 4px rgba(0,0,0,0.12), 0 07px 08px 0 rgba(0,0,0,0.20)",
|
|
158
|
-
16: "0 16px 24px 2px rgba(0,0,0,0.14), 0 06px 30px 5px rgba(0,0,0,0.12), 0 08px 10px 0 rgba(0,0,0,0.20)",
|
|
159
|
-
24: "0 24px 38px 3px rgba(0,0,0,0.14), 0 09px 46px 8px rgba(0,0,0,0.12), 0 11px 15px 0 rgba(0,0,0,0.20)"
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
@function insetPaddingTop($padding, $line-height: normal) {
|
|
163
|
-
@if ($line-height == normal) {
|
|
164
|
-
@return calc(#{$padding} - #{$font-top-gap * 1em});
|
|
165
|
-
}
|
|
166
|
-
@return calc(#{$padding} - #{$font-top-gap * 1em} - ((#{$line-height} - (#{$font-line-height * 1em})) / 2));
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
@function insetPaddingBottom($padding, $line-height: normal) {
|
|
170
|
-
@if ($line-height == normal) {
|
|
171
|
-
@return calc(#{$padding} - #{$font-bottom-gap * 1em});
|
|
172
|
-
}
|
|
173
|
-
@return calc(#{$padding} - #{$font-bottom-gap * 1em} - ((#{$line-height} - (#{$font-line-height * 1em})) / 2));
|
|
174
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
@import './variables.scss';
|
|
2
|
-
|
|
3
|
-
@mixin portraitHandsets {
|
|
4
|
-
@media screen
|
|
5
|
-
and (orientation:portrait)
|
|
6
|
-
and (max-width: $breakpoint-portrait-handset-max - 1) {
|
|
7
|
-
@content;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
@mixin landscapeHandsets {
|
|
11
|
-
@media screen
|
|
12
|
-
and (orientation:landscape)
|
|
13
|
-
and (max-width: $breakpoint-landscape-handset-max - 1) {
|
|
14
|
-
@content;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@mixin allHandsets {
|
|
19
|
-
@media
|
|
20
|
-
screen
|
|
21
|
-
and (orientation:portrait)
|
|
22
|
-
and (max-width: $breakpoint-portrait-handset-max - 1),
|
|
23
|
-
screen
|
|
24
|
-
and (orientation:landscape)
|
|
25
|
-
and (max-width: $breakpoint-landscape-handset-max - 1) {
|
|
26
|
-
@content;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@mixin allTablets {
|
|
31
|
-
@media
|
|
32
|
-
screen
|
|
33
|
-
and (orientation:portrait)
|
|
34
|
-
and (min-width: $breakpoint-portrait-tablet-small)
|
|
35
|
-
and (max-width: $breakpoint-portrait-tablet-max - 1),
|
|
36
|
-
screen
|
|
37
|
-
and (orientation:landscape)
|
|
38
|
-
and (min-width: $breakpoint-landscape-tablet-small)
|
|
39
|
-
and (max-width: $breakpoint-landscape-tablet-max - 1) {
|
|
40
|
-
@content;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@mixin allHandsetsAndTablets {
|
|
45
|
-
@media
|
|
46
|
-
screen
|
|
47
|
-
and (orientation:portrait)
|
|
48
|
-
and (max-width: $breakpoint-portrait-tablet-max - 1),
|
|
49
|
-
screen
|
|
50
|
-
and (orientation:landscape)
|
|
51
|
-
and (max-width: $breakpoint-landscape-tablet-max - 1) {
|
|
52
|
-
@content;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
$light: 1;
|
|
57
|
-
$dark: 2;
|
|
58
|
-
$dark-background: 3;
|
|
59
|
-
|
|
60
|
-
@mixin themeVariables($component, $map, $color, $contrast) {
|
|
61
|
-
@each $key in map-keys($map) {
|
|
62
|
-
$type: 'light';
|
|
63
|
-
@if ($contrast == 'dark') {
|
|
64
|
-
@if ($color == 'background') {
|
|
65
|
-
$type: 'dark-background';
|
|
66
|
-
} @else {
|
|
67
|
-
$type: 'dark';
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
$item: getThemeMapItem($map, $key, $type);
|
|
71
|
-
$value: null;
|
|
72
|
-
$length: length($item);
|
|
73
|
-
@if ($length == 1) {
|
|
74
|
-
$value: $item;
|
|
75
|
-
} @else if ($length == 2) {
|
|
76
|
-
$value: rgba(nth($item, 1), nth($item, 2));
|
|
77
|
-
} @else {
|
|
78
|
-
$color: nth($item,1);
|
|
79
|
-
$tone: nth($item,2);
|
|
80
|
-
$opacity: nth($item,3);
|
|
81
|
-
@if ($tone == null or tone == '500') {
|
|
82
|
-
$value: unquote("rgba(var(--#{$color}-color), #{$opacity})");
|
|
83
|
-
} @else {
|
|
84
|
-
$value: unquote("rgba(var(--#{$color}-#{$tone}-color), #{$opacity})");
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
--#{$component}__#{$key}: #{$value};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
@mixin IEOnly {
|
|
92
|
-
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
93
|
-
@content;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@mixin EdgeOnly {
|
|
98
|
-
@supports (-ms-ime-align:auto) {
|
|
99
|
-
@content;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@mixin MSOnly {
|
|
104
|
-
@include IEOnly {
|
|
105
|
-
@content;
|
|
106
|
-
}
|
|
107
|
-
@include EdgeOnly {
|
|
108
|
-
@content;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
@mixin gutter16dp {
|
|
113
|
-
@media
|
|
114
|
-
screen
|
|
115
|
-
and (orientation:portrait)
|
|
116
|
-
and (max-width: dp(600 - 1)),
|
|
117
|
-
screen
|
|
118
|
-
and (orientation:landscape)
|
|
119
|
-
and (max-height: dp(600 - 1)) {
|
|
120
|
-
@content;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// Motion Durations
|
|
2
|
-
// https://material.io/guidelines/motion/duration-easing.html#duration-easing-dynamic-durations
|
|
3
|
-
|
|
4
|
-
$motion-duration-mobile-default: 300ms;
|
|
5
|
-
$motion-duration-mobile-complex: 375ms;
|
|
6
|
-
$motion-duration-mobile-enter: 225ms;
|
|
7
|
-
$motion-duration-mobile-leave: 195ms;
|
|
8
|
-
$motion-duration-mobile-max: 400ms;
|
|
9
|
-
|
|
10
|
-
$motion-duration-tablet-default: $motion-duration-mobile-default * 1.30;
|
|
11
|
-
$motion-duration-tablet-complex: $motion-duration-mobile-complex * 1.30;
|
|
12
|
-
$motion-duration-tablet-enter: $motion-duration-mobile-enter * 1.30;
|
|
13
|
-
$motion-duration-tablet-leave: $motion-duration-mobile-leave * 1.30;
|
|
14
|
-
$motion-duration-tablet-max: $motion-duration-mobile-max * 1.30;
|
|
15
|
-
|
|
16
|
-
$motion-duration-wearable-default: $motion-duration-mobile-default * 0.70;
|
|
17
|
-
$motion-duration-wearable-complex: $motion-duration-mobile-complex * 0.70;
|
|
18
|
-
$motion-duration-wearable-enter: $motion-duration-mobile-enter * 0.70;
|
|
19
|
-
$motion-duration-wearable-leave: $motion-duration-mobile-leave * 0.70;
|
|
20
|
-
$motion-duration-wearable-max: $motion-duration-mobile-max * 0.70;
|
|
21
|
-
|
|
22
|
-
// Self-estimated
|
|
23
|
-
$motion-duration-desktop-default: 175ms;
|
|
24
|
-
$motion-duration-desktop-complex: 200ms;
|
|
25
|
-
$motion-duration-desktop-enter: 185ms;
|
|
26
|
-
$motion-duration-desktop-leave: 150ms;
|
|
27
|
-
$motion-duration-desktop-max: 300ms;
|
|
28
|
-
|
|
29
|
-
// Motion Easing Curves
|
|
30
|
-
// https://material.io/guidelines/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
31
|
-
|
|
32
|
-
$motion-easing-standard: cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
33
|
-
$motion-easing-deceleration: cubic-bezier(0.0, 0.0, 0.2, 1);
|
|
34
|
-
$motion-easing-acceleration: cubic-bezier(0.4, 0.0, 1, 1);
|
|
35
|
-
$motion-easing-sharp: cubic-bezier(0.4, 0.0, 0.6, 1);
|
|
36
|
-
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
$mdw-types: (
|
|
2
|
-
h1: (
|
|
3
|
-
font-weight: $font-weight-light,
|
|
4
|
-
letter-spacing: sp(-1.5),
|
|
5
|
-
font-size: sp(96),
|
|
6
|
-
line-height: dp(112),
|
|
7
|
-
),
|
|
8
|
-
h2: (
|
|
9
|
-
font-weight: $font-weight-light,
|
|
10
|
-
letter-spacing: sp(-0.5),
|
|
11
|
-
font-size: sp(60),
|
|
12
|
-
line-height: dp(72),
|
|
13
|
-
),
|
|
14
|
-
h3: (
|
|
15
|
-
font-weight: $font-weight-regular,
|
|
16
|
-
letter-spacing: 0,
|
|
17
|
-
font-size: sp(48),
|
|
18
|
-
line-height: dp(56),
|
|
19
|
-
),
|
|
20
|
-
h4: (
|
|
21
|
-
font-weight: $font-weight-regular,
|
|
22
|
-
letter-spacing: sp(0.25),
|
|
23
|
-
font-size: sp(34),
|
|
24
|
-
line-height: dp(40),
|
|
25
|
-
),
|
|
26
|
-
h5: (
|
|
27
|
-
font-weight: $font-weight-regular,
|
|
28
|
-
letter-spacing: 0,
|
|
29
|
-
font-size: sp(24),
|
|
30
|
-
line-height: dp(28),
|
|
31
|
-
),
|
|
32
|
-
h6: (
|
|
33
|
-
font-weight: $font-weight-medium,
|
|
34
|
-
letter-spacing: sp(0.15),
|
|
35
|
-
font-size: sp(20),
|
|
36
|
-
line-height: dp(24),
|
|
37
|
-
),
|
|
38
|
-
subtitle: (
|
|
39
|
-
font-weight: $font-weight-regular,
|
|
40
|
-
letter-spacing: sp(0.15),
|
|
41
|
-
font-size: sp(16),
|
|
42
|
-
line-height: dp(20),
|
|
43
|
-
),
|
|
44
|
-
subtitle-2: (
|
|
45
|
-
font-weight: $font-weight-medium,
|
|
46
|
-
letter-spacing: sp(0.1),
|
|
47
|
-
font-size: sp(14),
|
|
48
|
-
line-height: dp(16),
|
|
49
|
-
),
|
|
50
|
-
body: (
|
|
51
|
-
font-weight: $font-weight-regular,
|
|
52
|
-
letter-spacing: sp(0.5),
|
|
53
|
-
font-size: sp(16),
|
|
54
|
-
line-height: dp(24),
|
|
55
|
-
),
|
|
56
|
-
body-2: (
|
|
57
|
-
font-weight: $font-weight-regular,
|
|
58
|
-
letter-spacing: sp(0.25),
|
|
59
|
-
font-size: sp(14),
|
|
60
|
-
line-height: dp(20),
|
|
61
|
-
),
|
|
62
|
-
button: (
|
|
63
|
-
font-weight: $font-weight-medium,
|
|
64
|
-
text-transform: uppercase,
|
|
65
|
-
letter-spacing: sp(1.25),
|
|
66
|
-
font-size: sp(14),
|
|
67
|
-
line-height: dp(16),
|
|
68
|
-
),
|
|
69
|
-
caption: (
|
|
70
|
-
font-weight: $font-weight-regular,
|
|
71
|
-
letter-spacing: sp(0.4),
|
|
72
|
-
font-size: sp(12),
|
|
73
|
-
line-height: dp(16),
|
|
74
|
-
),
|
|
75
|
-
overline: (
|
|
76
|
-
font-weight: $font-weight-regular,
|
|
77
|
-
letter-spacing: sp(1.5),
|
|
78
|
-
font-size: sp(10),
|
|
79
|
-
line-height: dp(12),
|
|
80
|
-
),
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
@mixin type-rules($type) {
|
|
84
|
-
$rules: map-get($mdw-types, $type);
|
|
85
|
-
@each $key in map-keys($rules) {
|
|
86
|
-
#{$key}: map-get($rules, $key);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
@mixin baseline-top($dp) {
|
|
91
|
-
&::before {
|
|
92
|
-
content: '';
|
|
93
|
-
display: inline-block;
|
|
94
|
-
height: dp($dp);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@mixin baseline-bottom($dp) {
|
|
99
|
-
&::after {
|
|
100
|
-
content: '';
|
|
101
|
-
display: inline-block;
|
|
102
|
-
vertical-align: dp(-$dp);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
$breakpoint-portrait-handset-small: dp(0);
|
|
2
|
-
$breakpoint-portrait-handset-medium: dp(360);
|
|
3
|
-
$breakpoint-portrait-handset-large: dp(400);
|
|
4
|
-
$breakpoint-portrait-handset-max: dp(600);
|
|
5
|
-
|
|
6
|
-
$breakpoint-portrait-tablet-small: dp(600);
|
|
7
|
-
$breakpoint-portrait-tablet-large: dp(720);
|
|
8
|
-
$breakpoint-portrait-tablet-max: dp(840);
|
|
9
|
-
|
|
10
|
-
$breakpoint-landscape-handset-small: dp(480);
|
|
11
|
-
$breakpoint-landscape-handset-medium: dp(600);
|
|
12
|
-
$breakpoint-landscape-handset-large: dp(720);
|
|
13
|
-
$breakpoint-landscape-handset-max: dp(960);
|
|
14
|
-
|
|
15
|
-
$breakpoint-landscape-tablet-small: dp(960);
|
|
16
|
-
$breakpoint-landscape-tablet-large: dp(1024);
|
|
17
|
-
$breakpoint-landscape-tablet-max: dp(1280);
|
|
18
|
-
|
|
19
|
-
$breakpoint-window-xsmall: dp(0);
|
|
20
|
-
$breakpoint-window-small: dp(600);
|
|
21
|
-
$breakpoint-window-medium: dp(1024);
|
|
22
|
-
$breakpoint-window-large: dp(1440);
|
|
23
|
-
$breakpoint-window-xlarge: dp(1920);
|
|
24
|
-
|
|
25
|
-
$font-weight-thin: 100;
|
|
26
|
-
$font-weight-light: 300;
|
|
27
|
-
$font-weight-regular: 400; // normal
|
|
28
|
-
$font-weight-medium: 500;
|
|
29
|
-
$font-weight-bold: 700;
|
|
30
|
-
$font-weight-black: 900;
|
|
31
|
-
|
|
32
|
-
// From Roboto fontinfo.plist
|
|
33
|
-
|
|
34
|
-
$font-line-gap: 0;
|
|
35
|
-
$font-em-square: 2048;
|
|
36
|
-
$font-cap-height: 1456;
|
|
37
|
-
$font-ascender: 2146;
|
|
38
|
-
$font-descender: -555;
|
|
39
|
-
|
|
40
|
-
// Calculated
|
|
41
|
-
$font-line-height: ($font-ascender - $font-descender + $font-line-gap) / $font-em-square;
|
|
42
|
-
$font-top-gap: ($font-ascender - $font-cap-height) / $font-em-square;
|
|
43
|
-
$font-bottom-gap: -$font-descender / $font-em-square;
|
|
44
|
-
|
|
45
|
-
// Temporary workaround because ascent seems incorrect
|
|
46
|
-
$font-top-gap: $font-bottom-gap;
|