@pacem/pacem-theme-less 1.0.0-amaldi
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 +191 -0
- package/NOTICE +4 -0
- package/README.md +23 -0
- package/fonts-empty.less +11 -0
- package/pacem/2d/index.less +14 -0
- package/pacem/2d/stage.less +31 -0
- package/pacem/2d/text.less +16 -0
- package/pacem/3d/index.less +24 -0
- package/pacem/3d/stage.less +30 -0
- package/pacem/attributes.less +8 -0
- package/pacem/basic/dock.less +19 -0
- package/pacem/basic/drag-drop.less +75 -0
- package/pacem/basic/index.less +42 -0
- package/pacem/basic/repeater.less +3 -0
- package/pacem/basic/rescale.less +157 -0
- package/pacem/basic/resize.less +3 -0
- package/pacem/basic/scroll-aware.less +4 -0
- package/pacem/basic/swipe.less +22 -0
- package/pacem/basic/viewport-aware.less +4 -0
- package/pacem/body.less +197 -0
- package/pacem/charts/dark/column-line.less +10 -0
- package/pacem/charts/dark/column.less +61 -0
- package/pacem/charts/dark/index.less +9 -0
- package/pacem/charts/dark/line.less +111 -0
- package/pacem/charts/dark/pie.less +210 -0
- package/pacem/charts/dark/shared.less +88 -0
- package/pacem/charts/index.less +1 -0
- package/pacem/charts/light/index.less +2 -0
- package/pacem/charts/phousys/index.less +2 -0
- package/pacem/cms/datagrid-columns.less +41 -0
- package/pacem/cms/grid.less +23 -0
- package/pacem/cms/index.less +3 -0
- package/pacem/cms/shared.less +3 -0
- package/pacem/cms/widget.less +81 -0
- package/pacem/fonts-dark.less +7 -0
- package/pacem/fonts-light.less +7 -0
- package/pacem/fonts-none.less +1 -0
- package/pacem/fonts-phousys.less +8 -0
- package/pacem/fx/fancy.less +138 -0
- package/pacem/fx/gradient.less +21 -0
- package/pacem/fx/hero.less +12 -0
- package/pacem/fx/index.less +6 -0
- package/pacem/fx/list.less +11 -0
- package/pacem/fx/pulse.less +105 -0
- package/pacem/fx/ripple.less +66 -0
- package/pacem/icons.less +76 -0
- package/pacem/layout/animations.less +37 -0
- package/pacem/layout/dark/address.less +37 -0
- package/pacem/layout/dark/borders.less +102 -0
- package/pacem/layout/dark/breadcrumbs.less +85 -0
- package/pacem/layout/dark/cards.less +555 -0
- package/pacem/layout/dark/coloring.less +184 -0
- package/pacem/layout/dark/container.less +50 -0
- package/pacem/layout/dark/datatable.less +454 -0
- package/pacem/layout/dark/elevation.less +74 -0
- package/pacem/layout/dark/fetch-feedback.less +124 -0
- package/pacem/layout/dark/grid-system.less +181 -0
- package/pacem/layout/dark/grids.less +268 -0
- package/pacem/layout/dark/index.less +27 -0
- package/pacem/layout/dark/interactive.less +10 -0
- package/pacem/layout/dark/layout.less +616 -0
- package/pacem/layout/dark/lists.less +112 -0
- package/pacem/layout/dark/other.less +29 -0
- package/pacem/layout/dark/panels.less +299 -0
- package/pacem/layout/dark/positioning.less +273 -0
- package/pacem/layout/dark/scroll.less +93 -0
- package/pacem/layout/dark/shapes.less +22 -0
- package/pacem/layout/dark/sizing.less +108 -0
- package/pacem/layout/dark/spacing.less +296 -0
- package/pacem/layout/dark/superposition-system.less +116 -0
- package/pacem/layout/dark/tiles.less +71 -0
- package/pacem/layout/dark/tokens-chips.less +16 -0
- package/pacem/layout/dark/toolbar.less +32 -0
- package/pacem/layout/dark/typography.less +110 -0
- package/pacem/layout/dark/visibility.less +406 -0
- package/pacem/layout/index.less +2 -0
- package/pacem/layout/light/index.less +2 -0
- package/pacem/layout/light/layout.less +2 -0
- package/pacem/layout/mixins.less +445 -0
- package/pacem/layout/phousys/index.less +2 -0
- package/pacem/layout/phousys/layout.less +2 -0
- package/pacem/layout/shared.less +18 -0
- package/pacem/logging/console.less +3 -0
- package/pacem/logging/fps.less +6 -0
- package/pacem/logging/index.less +2 -0
- package/pacem/maps/index.less +21 -0
- package/pacem/media/dark/index.less +6 -0
- package/pacem/media/index.less +1 -0
- package/pacem/media/light/index.less +2 -0
- package/pacem/media/phousys/index.less +2 -0
- package/pacem/pacem-animations.less +202 -0
- package/pacem/pacem.less +448 -0
- package/pacem/palette-dark.less +0 -0
- package/pacem/palette-light.less +0 -0
- package/pacem/plus/carousel.less +370 -0
- package/pacem/plus/context-menu.less +31 -0
- package/pacem/plus/datagrid/datacell.less +10 -0
- package/pacem/plus/datagrid/headcell.less +32 -0
- package/pacem/plus/datagrid/index.less +48 -0
- package/pacem/plus/edit.less +42 -0
- package/pacem/plus/gallery.less +239 -0
- package/pacem/plus/index.less +7 -0
- package/pacem/plus/modal-form.less +27 -0
- package/pacem/plus/router-hash-state.less +6 -0
- package/pacem/reset.less +51 -0
- package/pacem/scaffolding/dark/calendar-picker.less +415 -0
- package/pacem/scaffolding/dark/char-counter.less +68 -0
- package/pacem/scaffolding/dark/chars.less +29 -0
- package/pacem/scaffolding/dark/checkbox-radio-shared.less +150 -0
- package/pacem/scaffolding/dark/checkbox.less +232 -0
- package/pacem/scaffolding/dark/childform.less +191 -0
- package/pacem/scaffolding/dark/color.less +128 -0
- package/pacem/scaffolding/dark/contenteditable/alignment.less +6 -0
- package/pacem/scaffolding/dark/contenteditable/dashboard.less +253 -0
- package/pacem/scaffolding/dark/contenteditable/index.less +4 -0
- package/pacem/scaffolding/dark/contenteditable/picture.less +74 -0
- package/pacem/scaffolding/dark/contenteditable/placeholder.less +24 -0
- package/pacem/scaffolding/dark/contenteditable.less +157 -0
- package/pacem/scaffolding/dark/datepicker.less +129 -0
- package/pacem/scaffolding/dark/dialog-overrides.less +32 -0
- package/pacem/scaffolding/dark/element-picker.less +11 -0
- package/pacem/scaffolding/dark/expression.less +34 -0
- package/pacem/scaffolding/dark/form.less +16 -0
- package/pacem/scaffolding/dark/formfield.less +1149 -0
- package/pacem/scaffolding/dark/geolocate.less +12 -0
- package/pacem/scaffolding/dark/hierarchy.less +82 -0
- package/pacem/scaffolding/dark/image.less +195 -0
- package/pacem/scaffolding/dark/index.less +57 -0
- package/pacem/scaffolding/dark/input.less +134 -0
- package/pacem/scaffolding/dark/latlng.less +163 -0
- package/pacem/scaffolding/dark/markdown.less +20 -0
- package/pacem/scaffolding/dark/namevalue-list.less +13 -0
- package/pacem/scaffolding/dark/number.less +12 -0
- package/pacem/scaffolding/dark/password.less +12 -0
- package/pacem/scaffolding/dark/property-picker.less +11 -0
- package/pacem/scaffolding/dark/radio.less +78 -0
- package/pacem/scaffolding/dark/search.less +29 -0
- package/pacem/scaffolding/dark/select.less +55 -0
- package/pacem/scaffolding/dark/slider.less +176 -0
- package/pacem/scaffolding/dark/snapshot.less +183 -0
- package/pacem/scaffolding/dark/suggest.less +115 -0
- package/pacem/scaffolding/dark/tags.less +149 -0
- package/pacem/scaffolding/dark/tel.less +11 -0
- package/pacem/scaffolding/dark/textarea.less +29 -0
- package/pacem/scaffolding/dark/upload.less +252 -0
- package/pacem/scaffolding/dark/url.less +9 -0
- package/pacem/scaffolding/dark/validators.less +36 -0
- package/pacem/scaffolding/index.less +2 -0
- package/pacem/scaffolding/light/index.less +2 -0
- package/pacem/scaffolding/phousys/index.less +2 -0
- package/pacem/scaffolding/shared.less +249 -0
- package/pacem/text-overrides.less +219 -0
- package/pacem/theme-dark.less +676 -0
- package/pacem/theme-light.less +119 -0
- package/pacem/theme-phousys-old.less +130 -0
- package/pacem/theme-phousys.less +153 -0
- package/pacem/transforms/index.less +7 -0
- package/pacem/ui/dark/anchor.less +45 -0
- package/pacem/ui/dark/balloon.less +566 -0
- package/pacem/ui/dark/binder.less +50 -0
- package/pacem/ui/dark/blade.less +110 -0
- package/pacem/ui/dark/body.less +5 -0
- package/pacem/ui/dark/bottom-sheet.less +69 -0
- package/pacem/ui/dark/button.less +716 -0
- package/pacem/ui/dark/calendar.less +660 -0
- package/pacem/ui/dark/collapse.less +23 -0
- package/pacem/ui/dark/dialog.less +17 -0
- package/pacem/ui/dark/divider.less +49 -0
- package/pacem/ui/dark/header-footer.less +5 -0
- package/pacem/ui/dark/icon.less +141 -0
- package/pacem/ui/dark/image.less +90 -0
- package/pacem/ui/dark/index.less +82 -0
- package/pacem/ui/dark/infinite-scroller.less +5 -0
- package/pacem/ui/dark/led.less +142 -0
- package/pacem/ui/dark/lightbox.less +140 -0
- package/pacem/ui/dark/loader.less +219 -0
- package/pacem/ui/dark/markdown.less +292 -0
- package/pacem/ui/dark/marquee.less +49 -0
- package/pacem/ui/dark/menu.less +578 -0
- package/pacem/ui/dark/pager.less +166 -0
- package/pacem/ui/dark/picture.less +146 -0
- package/pacem/ui/dark/progressbar.less +167 -0
- package/pacem/ui/dark/sidebar.less +144 -0
- package/pacem/ui/dark/slideshow.less +1 -0
- package/pacem/ui/dark/social.less +5 -0
- package/pacem/ui/dark/sticky-header.less +41 -0
- package/pacem/ui/dark/tabs.less +423 -0
- package/pacem/ui/dark/ticker.less +173 -0
- package/pacem/ui/dark/timeline.less +159 -0
- package/pacem/ui/dark/toast.less +232 -0
- package/pacem/ui/dark/toc.less +47 -0
- package/pacem/ui/dark/tuner.less +155 -0
- package/pacem/ui/dark/view.less +17 -0
- package/pacem/ui/dark/window.less +313 -0
- package/pacem/ui/dialog-vars.less +159 -0
- package/pacem/ui/index.less +1 -0
- package/pacem/ui/light/button.less +8 -0
- package/pacem/ui/light/index.less +3 -0
- package/pacem/ui/light/loader.less +2 -0
- package/pacem/ui/light/menu.less +2 -0
- package/pacem/ui/light/sidebar.less +2 -0
- package/pacem/ui/phousys/button.less +8 -0
- package/pacem/ui/phousys/index.less +3 -0
- package/pacem/ui/phousys/loader.less +2 -0
- package/pacem/ui/phousys/menu.less +2 -0
- package/pacem/ui/phousys/sidebar.less +2 -0
- package/pacem/ui/shared.less +125 -0
- package/package.json +39 -0
- package/shared.less +161 -0
- package/theme-empty.less +116 -0
- package/themebuilder.js +290 -0
package/shared.less
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
|
|
2
|
+
@font_icons_apiurl: e("");
|
|
3
|
+
@font_std_apiurl: e("");
|
|
4
|
+
@font_tech_apiurl: e("");
|
|
5
|
+
@font_main_apiurl: e("");
|
|
6
|
+
@font_btn_apiurl: e("");
|
|
7
|
+
@material_symbols_font: ~"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200";
|
|
8
|
+
|
|
9
|
+
@palette_colors: green, yellow, brown, red, pink, blue, orange, purple, teal, gray;
|
|
10
|
+
@semantic_colors: root, background, default, invert, primary, secondary, accent, info, success, warning, danger, error, disabled;
|
|
11
|
+
@all_colors: root, background, default, invert, primary, secondary, accent, info, success, warning, danger, error, disabled, green, yellow, brown, red, pink, blue, orange, purple, teal, gray;
|
|
12
|
+
|
|
13
|
+
@palette_prebuilt: false;
|
|
14
|
+
|
|
15
|
+
.Ellipsed(@max-width) {
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
-ms-text-overflow: ellipsis;
|
|
19
|
+
-o-text-overflow: ellipsis;
|
|
20
|
+
text-overflow: ellipsis;
|
|
21
|
+
max-width: @max-width;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.Inert() {
|
|
25
|
+
pointer-events: none !important;
|
|
26
|
+
display: none !important;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.Blur(@radius) {
|
|
30
|
+
-webkit-backdrop-filter: blur(@radius);
|
|
31
|
+
backdrop-filter: blur(@radius);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.Blur(@radius, @bgcolor) {
|
|
35
|
+
background-color: fade(@bgcolor, 50);
|
|
36
|
+
.Blur(@radius);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.Grayscale() {
|
|
40
|
+
filter: grayscale(100%);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/*.Corners(@clr) {
|
|
44
|
+
.Corners(@clr, 0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.Corners(@clr, @sz) {
|
|
48
|
+
.Corners(@clr, @sz, 6px);
|
|
49
|
+
}*/
|
|
50
|
+
|
|
51
|
+
.Corners(@clr, @roundsz, @defaultsz) {
|
|
52
|
+
@brd2: rgba(red(@clr), green(@clr), blue(@clr), min(.99, alpha(@clr)));
|
|
53
|
+
@strk: 2;
|
|
54
|
+
@render: 'geometricPrecision'; /*'crispEdges';*/
|
|
55
|
+
|
|
56
|
+
&when(@roundsz = 0) {
|
|
57
|
+
// straight corner
|
|
58
|
+
@sz2: unit(@defaultsz);
|
|
59
|
+
background-size: unit(@sz2, px);
|
|
60
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='@{sz2}' height='@{sz2}' viewBox='0 0 @{sz2} @{sz2}'%3E%3Cpath shape-rendering='@{render}' stroke='@{brd2}' fill='transparent' stroke-width='@{strk}' d='M0,@{sz2} V0 H@{sz2}'%3E%3C/path%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='@{sz2}' height='@{sz2}' viewBox='0 0 @{sz2} @{sz2}'%3E%3Cpath shape-rendering='@{render}' stroke='@{brd2}' fill='transparent' stroke-width='@{strk}' d='M0,0 H@{sz2} V@{sz2}'%3E%3C/path%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='@{sz2}' height='@{sz2}' viewBox='0 0 @{sz2} @{sz2}'%3E%3Cpath shape-rendering='@{render}' stroke='@{brd2}' fill='transparent' stroke-width='@{strk}' d='M@{sz2},0 V@{sz2} H0'%3E%3C/path%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='@{sz2}' height='@{sz2}' viewBox='0 0 @{sz2} @{sz2}'%3E%3Cpath shape-rendering='@{render}' stroke='@{brd2}' fill='transparent' stroke-width='@{strk}' d='M@{sz2},@{sz2} H0 V0'%3E%3C/path%3E%3C/svg%3E");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&when(@roundsz > 0) {
|
|
64
|
+
// arc
|
|
65
|
+
@sz2: unit(@roundsz);
|
|
66
|
+
background-size: unit(@sz2, px);
|
|
67
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='@{sz2}' height='@{sz2}' viewBox='0 0 @{sz2} @{sz2}'%3E%3Cpath shape-rendering='@{render}' stroke='@{brd2}' fill='transparent' stroke-width='@{strk}' d='M0,@{sz2} a@{sz2},@{sz2} 0 0,1 @{sz2},-@{sz2}'%3E%3C/path%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='@{sz2}' height='@{sz2}' viewBox='0 0 @{sz2} @{sz2}'%3E%3Cpath shape-rendering='@{render}' stroke='@{brd2}' fill='transparent' stroke-width='@{strk}' d='M0,0 a@{sz2},@{sz2} 0 0,1 @{sz2},@{sz2}'%3E%3C/path%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='@{sz2}' height='@{sz2}' viewBox='0 0 @{sz2} @{sz2}'%3E%3Cpath shape-rendering='@{render}' stroke='@{brd2}' fill='transparent' stroke-width='@{strk}' d='M@{sz2},0 a@{sz2},@{sz2} 0 0,1 -@{sz2},@{sz2}'%3E%3C/path%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='@{sz2}' height='@{sz2}' viewBox='0 0 @{sz2} @{sz2}'%3E%3Cpath shape-rendering='@{render}' stroke='@{brd2}' fill='transparent' stroke-width='@{strk}' d='M@{sz2},@{sz2} a@{sz2},@{sz2} 0 0,1 -@{sz2},-@{sz2}'%3E%3C/path%3E%3C/svg%3E");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
background-position: top left, top right, bottom right, bottom left;
|
|
71
|
+
background-repeat: no-repeat;
|
|
72
|
+
background-origin: border-box;
|
|
73
|
+
|
|
74
|
+
&.corners-safe {
|
|
75
|
+
// margin to avoid corners disappearing
|
|
76
|
+
margin: 1px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.GradientBorderVertical(@size, @from, @to, @color1, @color2) {
|
|
81
|
+
border-image: linear-gradient(to bottom, @color1 @from,@color2 @to) @size;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.GradientVertical(@from, @to, @color1, @color2) {
|
|
85
|
+
background: @color2;
|
|
86
|
+
background: -moz-linear-gradient(top, @color1 @from, @color2 @to);
|
|
87
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(@from,@color1), color-stop(@to,@color2));
|
|
88
|
+
background: -webkit-linear-gradient(top, @color1 @from,@color2 @to);
|
|
89
|
+
background: -o-linear-gradient(top, @color1 @from,@color2 @to);
|
|
90
|
+
background: -ms-linear-gradient(top, @color1 @from,@color2 @to);
|
|
91
|
+
background: linear-gradient(to bottom, @color1 @from,@color2 @to);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.GradientVertical(@color1, @color2, @img) {
|
|
95
|
+
background: @color2;
|
|
96
|
+
background-image: url(@img); /* fallback */
|
|
97
|
+
background-image: url(@img), -webkit-gradient(linear, left top, left bottom, from(@color1), to(@color2)); /* Saf4+, Chrome */
|
|
98
|
+
background-image: url(@img), -webkit-linear-gradient(top, @color1, @color2); /* Chrome 10+, Saf5.1+ */
|
|
99
|
+
background-image: url(@img), -moz-linear-gradient(top, @color1, @color2); /* FF3.6+ */
|
|
100
|
+
background-image: url(@img), -ms-linear-gradient(top, @color1, @color2); /* IE10 */
|
|
101
|
+
background-image: url(@img), -o-linear-gradient(top, @color1, @color2); /* Opera 11.10+ */
|
|
102
|
+
background-image: url(@img), linear-gradient(to bottom, @color1, @color2);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.GradientVertical(@step1, @step2, @step3, @color1, @color2, @color3) {
|
|
106
|
+
background: @color2;
|
|
107
|
+
background: -moz-linear-gradient(top, @color1 @step1, @color2 @step2, @color3 @step3);
|
|
108
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(@step1,@color1), color-stop(@step2,@color2), color-stop(@step3,@color3));
|
|
109
|
+
background: -webkit-linear-gradient(top, @color1 @step1,@color2 @step2,@color3 @step3);
|
|
110
|
+
background: -o-linear-gradient(top, @color1 @step1,@color2 @step2,@color3 @step3);
|
|
111
|
+
background: -ms-linear-gradient(top, @color1 @step1,@color2 @step2,@color3 @step3);
|
|
112
|
+
background: linear-gradient(to bottom, @color1 @step1,@color2 @step2,@color3 @step3);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.GradientVertical(@step1, @step2, @step3, @step4, @color1, @color2, @color3, @color4) {
|
|
116
|
+
background: @color2;
|
|
117
|
+
background: -moz-linear-gradient(top, @color1 @step1, @color2 @step2, @color3 @step3, @color4 @step4);
|
|
118
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(@step1,@color1), color-stop(@step2,@color2), color-stop(@step3,@color3), color-stop(@step4,@color4));
|
|
119
|
+
background: -webkit-linear-gradient(top, @color1 @step1,@color2 @step2,@color3 @step3,@color4 @step4);
|
|
120
|
+
background: -o-linear-gradient(top, @color1 @step1,@color2 @step2,@color3 @step3,@color4 @step4);
|
|
121
|
+
background: -ms-linear-gradient(top, @color1 @step1,@color2 @step2,@color3 @step3,@color4 @step4);
|
|
122
|
+
background: linear-gradient(to bottom, @color1 @step1,@color2 @step2,@color3 @step3,@color4 @step4);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.GradientVertical(@color1, @color2) {
|
|
126
|
+
.GradientVertical(0, 100%, @color1, @color2);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.GradientHorizontal(@step1, @step2, @step3, @step4, @color1, @color2, @color3, @color4) {
|
|
130
|
+
background: @color2;
|
|
131
|
+
background: -moz-linear-gradient(left, @color1 @step1, @color2 @step2, @color3 @step3, @color4 @step4);
|
|
132
|
+
background: -webkit-gradient(linear, left top, right top, color-stop(@step1,@color1), color-stop(@step2,@color2), color-stop(@step3,@color3), color-stop(@step4,@color4));
|
|
133
|
+
background: -webkit-linear-gradient(left, @color1 @step1,@color2 @step2,@color3 @step3,@color4 @step4);
|
|
134
|
+
background: -o-linear-gradient(left, @color1 @step1,@color2 @step2,@color3 @step3,@color4 @step4);
|
|
135
|
+
background: -ms-linear-gradient(left, @color1 @step1,@color2 @step2,@color3 @step3,@color4 @step4);
|
|
136
|
+
background: linear-gradient(to right, @color1 @step1,@color2 @step2,@color3 @step3,@color4 @step4);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.GradientRadial(@from, @to, @color1, @color2) {
|
|
140
|
+
background: @color1;
|
|
141
|
+
background: -moz-radial-gradient(center, ellipse cover, @color1 @from, @color2 @to);
|
|
142
|
+
background: -webkit-gradient(radial, center center, 0, center center, 100%, color-stop(@from,@color1), color-stop(@to,@color2));
|
|
143
|
+
background: -webkit-radial-gradient(center, ellipse cover, @color1 @from,@color2 @to);
|
|
144
|
+
background: -o-radial-gradient(center, ellipse cover, @color1 @from,@color2 @to);
|
|
145
|
+
background: -ms-radial-gradient(center, ellipse cover, @color1 @from,@color2 @to);
|
|
146
|
+
background: radial-gradient(ellipse at center, @color1 @from,@color2 @to);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.GradientRadial(@from, @to, @color1, @color2, @img) {
|
|
150
|
+
background-image: url(@img); /* fallback */
|
|
151
|
+
background-image: url(@img), -moz-radial-gradient(center, ellipse cover, @color1 @from, @color2 @to);
|
|
152
|
+
background-image: url(@img), -webkit-gradient(radial, center center, 0, center center, 100%, color-stop(@from,@color1), color-stop(@to,@color2));
|
|
153
|
+
background-image: url(@img), -webkit-radial-gradient(center, ellipse cover, @color1 @from,@color2 @to);
|
|
154
|
+
background-image: url(@img), -o-radial-gradient(center, ellipse cover, @color1 @from,@color2 @to);
|
|
155
|
+
background-image: url(@img), -ms-radial-gradient(center, ellipse cover, @color1 @from,@color2 @to);
|
|
156
|
+
background-image: url(@img), radial-gradient(ellipse at center, @color1 @from,@color2 @to);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.GradientRadialContain( @step1, @step2, @step3, @step4, @step5, @step6,@step7, @step8, @step9, @step10, @color1, @color2, @color3,@color4, @color5, @color6,@color7, @color8, @color9, @color10) {
|
|
160
|
+
background: radial-gradient(circle closest-side, @color1 @step1, @color2 @step2, @color3 @step3, @color4 @step4, @color5 @step5, @color6 @step6, @color7 @step7, @color8 @step8, @color9 @step9, @color10 @step10);
|
|
161
|
+
}
|
package/theme-empty.less
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* #region VARIABLES*/
|
|
2
|
+
|
|
3
|
+
@grid_cell: 76px;
|
|
4
|
+
@grid_spacing: 24px;
|
|
5
|
+
|
|
6
|
+
@dark_theme: true;
|
|
7
|
+
@shadows: true;
|
|
8
|
+
@gradients: true;
|
|
9
|
+
@glows: false;
|
|
10
|
+
@border_radius: 0;
|
|
11
|
+
|
|
12
|
+
@font_weight: 300;
|
|
13
|
+
@font_main: 'PT Sans Narrow', 'Segoe UI Light', Helvetica, sans-serif;
|
|
14
|
+
@font_tech: 'Share Tech Mono', Monotype;
|
|
15
|
+
@font_icons: 'Material Symbols Outlined';
|
|
16
|
+
@font_size: 14px;
|
|
17
|
+
@font_std: 'Roboto Condensed', 'Segoe UI', Helvetica, sans-serif;
|
|
18
|
+
@font_rem_factor: 1; // <- adjustment factor for @font_std vs @font_size
|
|
19
|
+
|
|
20
|
+
@color_error: #f00;
|
|
21
|
+
@color_error_inv: #fff;
|
|
22
|
+
@color_highlight: #a7f8ab;
|
|
23
|
+
@color_highlight_fore: #000;
|
|
24
|
+
@color_tech: fade( @color_highlight, 60);
|
|
25
|
+
@color_watermark: #c0c0c0;
|
|
26
|
+
@color_light: #fff;
|
|
27
|
+
@color_dark: #000;
|
|
28
|
+
|
|
29
|
+
/*#endregion*/
|
|
30
|
+
/*#region STD-VARIABLES */
|
|
31
|
+
@color_default: @color_light; // text-color
|
|
32
|
+
@color_default_inv: @color_dark; // contrast color against _default
|
|
33
|
+
@color_background: #1e2336; // background-color
|
|
34
|
+
@color_success: @color_highlight;
|
|
35
|
+
@color_success_inv: darken(@color_success, 50);
|
|
36
|
+
@color_warning: #d5d033;
|
|
37
|
+
@color_warning_inv: darken(@color_warning, 35);
|
|
38
|
+
@color_danger: @color_error;
|
|
39
|
+
@color_danger_inv: @color_error_inv;
|
|
40
|
+
@color_accent: #ff0085;
|
|
41
|
+
@color_accent_inv: @color_light;
|
|
42
|
+
@color_primary: #429bbb;
|
|
43
|
+
@color_primary_inv: @color_light;
|
|
44
|
+
@color_disabled: @color_watermark;
|
|
45
|
+
|
|
46
|
+
@uppercase_headings: true;
|
|
47
|
+
@uppercase_carousels: @uppercase_headings;
|
|
48
|
+
@uppercase_buttons: @uppercase_headings;
|
|
49
|
+
|
|
50
|
+
@size_scrollbar: 10px;
|
|
51
|
+
@color_scrollbar_track: rgba(0,0,0,0.0);
|
|
52
|
+
@color_scrollbar_thumb: #262b3e;
|
|
53
|
+
@color_border: fade(@color_default, 10);
|
|
54
|
+
/*#endregion*/
|
|
55
|
+
/*#region BUTTON VARIABLES*/
|
|
56
|
+
@color_button_border_light: fade(@color_light, 33);
|
|
57
|
+
@color_button_border: fade(@color_light, 0);
|
|
58
|
+
@color_button_border_dark: fade(@color_dark, 0);
|
|
59
|
+
@color_button_back: #262b3e;
|
|
60
|
+
@color_button_fore: @color_light;
|
|
61
|
+
@button_hover_percentage: 10;
|
|
62
|
+
@button_fontfamily: @font_std;
|
|
63
|
+
@button_fontsize: 1.1rem * @font_rem_factor;
|
|
64
|
+
/*#endregion*/
|
|
65
|
+
/*#region UI VARIABLES*/
|
|
66
|
+
@color_link: @color_primary;
|
|
67
|
+
// menu
|
|
68
|
+
@menu_link_color: fade(@color_default, 60);
|
|
69
|
+
@menu_link_hover_color: @color_default;
|
|
70
|
+
@menu_link_active_color: @color_primary;
|
|
71
|
+
@menu_link_active_backgroundcolor: fade(@color_default, 5);
|
|
72
|
+
@menu_link_fontfamily: @font_std;
|
|
73
|
+
@menu_link_fontsize: 1rem * @font_rem_factor;
|
|
74
|
+
// balloon
|
|
75
|
+
@balloon_color: #262b3e;
|
|
76
|
+
@balloon_color_contrast: @color_background;
|
|
77
|
+
// calendar/schedule/agenda
|
|
78
|
+
@color_calendarday_hover: fade(@color_default, 5);
|
|
79
|
+
@color_calendarday_focus: fade(@color_primary, 5);
|
|
80
|
+
@color_calendarday_today: fade(@color_primary, 2.5);
|
|
81
|
+
@color_agenda_clock: fade(@color_default, 25);
|
|
82
|
+
@color_event_back: darken(@balloon_color, 5);
|
|
83
|
+
@color_event_fore: @color_default;
|
|
84
|
+
@color_schedule_header: @color_border;
|
|
85
|
+
@color_schedule_subheader: @color_background;
|
|
86
|
+
// suggest
|
|
87
|
+
@color_suggest_border: #1e2336;
|
|
88
|
+
@color_suggest_back: #262b3e;
|
|
89
|
+
@color_suggest_border_light: rgba(255,255,255,0.1);
|
|
90
|
+
@color_suggest_border_dark: rgba(0,0,0,0.25);
|
|
91
|
+
@color_suggest_highlight: #429bbb;
|
|
92
|
+
@color_suggest_focus_back: #429bbb;
|
|
93
|
+
@color_suggest_focus_fore: @color_light;
|
|
94
|
+
@color_suggest_focus_highlight: #1e2336;
|
|
95
|
+
// tab
|
|
96
|
+
@color_tab_highlight: @color_highlight;
|
|
97
|
+
// lightbox
|
|
98
|
+
@color_lightbox_back: fade(@color_dark, 50);
|
|
99
|
+
// map
|
|
100
|
+
@color_map: @color_dark;
|
|
101
|
+
// marquee
|
|
102
|
+
@color_marquee_back: @color_dark;
|
|
103
|
+
@color_marquee_back2: darken(@color_background, 3);
|
|
104
|
+
@color_marquee_fore: @color_default;
|
|
105
|
+
/*#endregion*/
|
|
106
|
+
/*#region SCAFFOLDING_VARIABLES*/
|
|
107
|
+
@color_field_back: #262b3e;
|
|
108
|
+
@color_field_label: #429bbb;
|
|
109
|
+
@border_field_size: 2px;
|
|
110
|
+
@color_input_toggle: @color_primary;
|
|
111
|
+
@color_input_icon: @color_primary;
|
|
112
|
+
/*#endregion*/
|
|
113
|
+
/*#region MIXINS*/
|
|
114
|
+
.Background() {
|
|
115
|
+
// add your body background here, if any complex...
|
|
116
|
+
}
|
package/themebuilder.js
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import yargs from 'yargs';
|
|
4
|
+
import { hideBin } from 'yargs/helpers';
|
|
5
|
+
import { Colors, NullChecker } from '@pacem/pacem-foundation';
|
|
6
|
+
import { Mathematics } from '@pacem/pacem-numerical';
|
|
7
|
+
const argv = yargs(hideBin(process.argv))
|
|
8
|
+
.option('theme', {
|
|
9
|
+
alias: 't',
|
|
10
|
+
type: 'string',
|
|
11
|
+
description: 'Theme (dark or light)',
|
|
12
|
+
})
|
|
13
|
+
.option('name', {
|
|
14
|
+
alias: 'n',
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'Theme name',
|
|
17
|
+
})
|
|
18
|
+
.option('src', {
|
|
19
|
+
alias: 's',
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'Palette file containing the color variables in JSON format.',
|
|
22
|
+
})
|
|
23
|
+
.option('out', {
|
|
24
|
+
alias: 'o',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Output file (overrides name option).',
|
|
27
|
+
})
|
|
28
|
+
.option('void', {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'Creates an empty palette file.',
|
|
31
|
+
})
|
|
32
|
+
.option('mincontrast', {
|
|
33
|
+
type: 'number',
|
|
34
|
+
description: 'The minimum WCAG contrast (1 to 21) container-to-background (default 1.5).',
|
|
35
|
+
})
|
|
36
|
+
.option('maxcontrast', {
|
|
37
|
+
type: 'number',
|
|
38
|
+
description: 'The maximum WCAG contrast (1 to 21) default-to-background (default 15).',
|
|
39
|
+
})
|
|
40
|
+
.option('contrast', {
|
|
41
|
+
type: 'number',
|
|
42
|
+
description: 'The minimim WCAG contrast (1 to 21) solid color-to-background (default 4.5).',
|
|
43
|
+
})
|
|
44
|
+
.help()
|
|
45
|
+
.argv;
|
|
46
|
+
const darkTheme = argv.theme === 'dark';
|
|
47
|
+
const themeName = argv.name ?? (darkTheme ? 'dark' : 'light');
|
|
48
|
+
function absolutePath(relativePath) {
|
|
49
|
+
return path.join(import.meta.dirname, relativePath);
|
|
50
|
+
}
|
|
51
|
+
function readFile(src) {
|
|
52
|
+
if (src == null) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const json = fs.readFileSync(src, 'utf-8');
|
|
56
|
+
return JSON.parse(json);
|
|
57
|
+
}
|
|
58
|
+
const palette = Object.assign({
|
|
59
|
+
background: '#1e2336',
|
|
60
|
+
primary: '#429bbb',
|
|
61
|
+
secondary: '#5e7881',
|
|
62
|
+
accent: '#ff0085',
|
|
63
|
+
success: '#4dc2b4',
|
|
64
|
+
warning: '#c5c023',
|
|
65
|
+
error: '#BF215B',
|
|
66
|
+
danger: '#fa1f1f',
|
|
67
|
+
info: '#99d4ff',
|
|
68
|
+
green: '#1ebb8f',
|
|
69
|
+
yellow: '#c2b010',
|
|
70
|
+
brown: '#a6715e',
|
|
71
|
+
red: '#dd2020',
|
|
72
|
+
pink: '#ff0085',
|
|
73
|
+
blue: '#116e8b',
|
|
74
|
+
orange: '#d46d00',
|
|
75
|
+
purple: '#624472',
|
|
76
|
+
teal: '#429bbb',
|
|
77
|
+
gray: '#808080',
|
|
78
|
+
}, readFile(argv.src) ?? {});
|
|
79
|
+
const WCAG_MINIMUM_CONTRAST = argv.mincontrast ?? 1.5;
|
|
80
|
+
const WCAG_NORMAL_TEXT_CONTRAST = 4.5;
|
|
81
|
+
const WCAG_NORMAL_COLOR_CONTRAST = argv.contrast ?? WCAG_NORMAL_TEXT_CONTRAST;
|
|
82
|
+
const WCAG_SAFE_CONTRAST = 7;
|
|
83
|
+
const WCAG_MAX_CONTRAST = argv.maxcontrast ?? 15;
|
|
84
|
+
const WCAG_DISABLED_CONTRAST = 1.6;
|
|
85
|
+
const SURFACE_LIGHT = .95;
|
|
86
|
+
const SURFACE_DARK = .02;
|
|
87
|
+
const MIN_SATURATION = .175;
|
|
88
|
+
const searchFn = Mathematics.DataAnalysis.SearchFunctions.goldenRatio;
|
|
89
|
+
let backgroundModule;
|
|
90
|
+
let rootModule;
|
|
91
|
+
function isColorLight(clr) {
|
|
92
|
+
return Colors.luminance(clr) >= .2;
|
|
93
|
+
}
|
|
94
|
+
function contrastColor(baseColor, arg1 = baseColor, arg2 = WCAG_NORMAL_TEXT_CONTRAST, arg3 = null) {
|
|
95
|
+
const benchmarkColor = typeof arg1 === 'object' ? arg1 : baseColor;
|
|
96
|
+
const targetContrast = typeof arg1 === 'number' ? arg1 : (typeof arg2 === 'number' ? arg2 : WCAG_NORMAL_TEXT_CONTRAST);
|
|
97
|
+
const lighterColor = typeof arg2 === 'boolean' ? arg2 : arg3;
|
|
98
|
+
const { h, s, l, a } = Colors.hsl(baseColor);
|
|
99
|
+
const isDark = lighterColor ?? !isColorLight(baseColor);
|
|
100
|
+
const min = isDark ? l : 0;
|
|
101
|
+
const max = isDark ? 1 : l;
|
|
102
|
+
const newL = searchFn(min, max, x => Math.abs(targetContrast - Colors.contrastRatio(benchmarkColor, { h, s, l: x, a })).roundoff());
|
|
103
|
+
return Colors.rgb({ h, s, l: newL, a });
|
|
104
|
+
}
|
|
105
|
+
function luminanceColor(baseColor, targetLuminance) {
|
|
106
|
+
const { h, s, a } = Colors.hsl(baseColor);
|
|
107
|
+
const newL = searchFn(0, 1, x => Math.abs(targetLuminance - Colors.luminance({ h, s, l: x, a })));
|
|
108
|
+
return Colors.rgb({ h, s, l: newL, a });
|
|
109
|
+
}
|
|
110
|
+
function invertModule(mod) {
|
|
111
|
+
return {
|
|
112
|
+
base: mod.contrast,
|
|
113
|
+
contrast: mod.base,
|
|
114
|
+
active: mod.activeContrast,
|
|
115
|
+
activeContrast: mod.active,
|
|
116
|
+
emphasis: mod.base,
|
|
117
|
+
container: mod.containerContrast,
|
|
118
|
+
containerContrast: mod.container,
|
|
119
|
+
containerActive: mod.containerActiveContrast,
|
|
120
|
+
containerActiveContrast: mod.containerActive,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function desaturateColor(clr, threshold = MIN_SATURATION) {
|
|
124
|
+
const { h, s, l, a } = Colors.hsl(clr);
|
|
125
|
+
if (s > threshold) {
|
|
126
|
+
return Colors.rgb({ h, s: threshold, l, a });
|
|
127
|
+
}
|
|
128
|
+
else
|
|
129
|
+
return clr;
|
|
130
|
+
}
|
|
131
|
+
function colorModuleBackground(clr, name, arg2) {
|
|
132
|
+
const forcedContrast = (arg2 && typeof arg2 === 'number') ? arg2 : null;
|
|
133
|
+
const baseContrast = forcedContrast ?? WCAG_MAX_CONTRAST;
|
|
134
|
+
const contrastClr = arg2 && typeof arg2 === 'object' ? arg2 : null;
|
|
135
|
+
const surfaceLight = name === 'background' ? SURFACE_LIGHT + .015 : SURFACE_LIGHT;
|
|
136
|
+
const isColorRight = (darkTheme ? Colors.luminance(clr) <= SURFACE_DARK : Colors.luminance(clr) >= surfaceLight);
|
|
137
|
+
const darkTargetLuminance = SURFACE_DARK;
|
|
138
|
+
const lightTargetLuminance = surfaceLight;
|
|
139
|
+
const referenceColor = isColorRight ? clr
|
|
140
|
+
: (!darkTheme ? luminanceColor(clr, lightTargetLuminance) : luminanceColor(clr, darkTargetLuminance));
|
|
141
|
+
let actualColor = contrastClr ? clr : referenceColor;
|
|
142
|
+
const luminanceBackActiveOffset = darkTheme ? .035 : -.08;
|
|
143
|
+
const contrastForeActive = forcedContrast ?? WCAG_SAFE_CONTRAST;
|
|
144
|
+
const contrast = contrastClr ?? contrastColor(actualColor, baseContrast);
|
|
145
|
+
const containerTargetContrast = WCAG_MINIMUM_CONTRAST;
|
|
146
|
+
const containerBenchmarkColor = actualColor;
|
|
147
|
+
const container = contrastColor(actualColor, containerBenchmarkColor, containerTargetContrast, darkTheme);
|
|
148
|
+
const containerContrast = contrastColor(container, WCAG_NORMAL_TEXT_CONTRAST);
|
|
149
|
+
const active = luminanceColor(actualColor, Colors.luminance(actualColor) + luminanceBackActiveOffset);
|
|
150
|
+
const activeContrast = contrastColor(active, contrastForeActive);
|
|
151
|
+
const containerActive = luminanceColor(container, Colors.luminance(container) + luminanceBackActiveOffset);
|
|
152
|
+
const containerActiveContrast = contrastColor(containerActive, contrastForeActive);
|
|
153
|
+
const emphasis = Colors.saturate(actualColor, 1.2);
|
|
154
|
+
return {
|
|
155
|
+
base: actualColor,
|
|
156
|
+
contrast,
|
|
157
|
+
active,
|
|
158
|
+
activeContrast,
|
|
159
|
+
containerActive,
|
|
160
|
+
container,
|
|
161
|
+
emphasis,
|
|
162
|
+
containerActiveContrast,
|
|
163
|
+
containerContrast
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function colorModuleDisabled(clr) {
|
|
167
|
+
const baseContrast = Math.min(WCAG_MINIMUM_CONTRAST, WCAG_DISABLED_CONTRAST);
|
|
168
|
+
const containerBenchmarkColor = backgroundModule.base;
|
|
169
|
+
const preferBaseWithLighterColor = darkTheme;
|
|
170
|
+
const preferContrastWithLighterColor = !preferBaseWithLighterColor;
|
|
171
|
+
const referenceColor = contrastColor(clr, containerBenchmarkColor, 1);
|
|
172
|
+
const actualColor = contrastColor(desaturateColor(referenceColor), containerBenchmarkColor, baseContrast, preferBaseWithLighterColor);
|
|
173
|
+
const luminanceBackActiveOffset = darkTheme ? .1 : -.06;
|
|
174
|
+
const contrast = contrastColor(actualColor, baseContrast, preferContrastWithLighterColor);
|
|
175
|
+
const containerTargetContrast = 1.1;
|
|
176
|
+
const container = contrastColor(actualColor, containerBenchmarkColor, containerTargetContrast, preferContrastWithLighterColor);
|
|
177
|
+
const containerContrast = contrastColor(container, baseContrast, preferBaseWithLighterColor);
|
|
178
|
+
const active = luminanceColor(actualColor, Colors.luminance(actualColor) + luminanceBackActiveOffset);
|
|
179
|
+
const activeContrast = contrastColor(active, baseContrast, preferContrastWithLighterColor);
|
|
180
|
+
const containerActive = luminanceColor(container, Colors.luminance(container) + luminanceBackActiveOffset);
|
|
181
|
+
const containerActiveContrast = contrastColor(containerActive, baseContrast);
|
|
182
|
+
const emphasis = Colors.lighten(actualColor, .1);
|
|
183
|
+
return {
|
|
184
|
+
base: actualColor,
|
|
185
|
+
contrast,
|
|
186
|
+
active,
|
|
187
|
+
activeContrast,
|
|
188
|
+
containerActive,
|
|
189
|
+
container,
|
|
190
|
+
emphasis,
|
|
191
|
+
containerActiveContrast,
|
|
192
|
+
containerContrast
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function colorModule(clr, name, arg2) {
|
|
196
|
+
const isDesaturated = name === 'gray';
|
|
197
|
+
const forcedContrast = (arg2 && typeof arg2 === 'number') ? arg2 : null;
|
|
198
|
+
const baseContrast = forcedContrast ?? WCAG_SAFE_CONTRAST;
|
|
199
|
+
const contrastClr = arg2 && typeof arg2 === 'object' ? arg2 : null;
|
|
200
|
+
const isColorRight = isColorLight(clr) === darkTheme && Colors.contrastRatio(clr, backgroundModule.base) >= WCAG_NORMAL_COLOR_CONTRAST;
|
|
201
|
+
const referenceColor = isColorRight ? clr
|
|
202
|
+
: contrastColor(clr, backgroundModule.base, WCAG_NORMAL_COLOR_CONTRAST, darkTheme);
|
|
203
|
+
let actualColor = contrastClr ? clr : referenceColor;
|
|
204
|
+
if (isDesaturated) {
|
|
205
|
+
actualColor = desaturateColor(actualColor);
|
|
206
|
+
}
|
|
207
|
+
const luminanceBackActiveOffset = darkTheme ? .1 : -.06;
|
|
208
|
+
const contrastForeActive = forcedContrast ?? WCAG_SAFE_CONTRAST;
|
|
209
|
+
const contrast = contrastClr ?? contrastColor(actualColor, baseContrast, !darkTheme);
|
|
210
|
+
const containerTargetContrast = WCAG_MINIMUM_CONTRAST;
|
|
211
|
+
const containerBenchmarkColor = backgroundModule.base;
|
|
212
|
+
const container = contrastColor(actualColor, containerBenchmarkColor, containerTargetContrast, !darkTheme);
|
|
213
|
+
const containerContrast = contrastColor(container, WCAG_NORMAL_TEXT_CONTRAST, darkTheme);
|
|
214
|
+
const active = luminanceColor(actualColor, Colors.luminance(actualColor) + luminanceBackActiveOffset);
|
|
215
|
+
const activeContrast = contrastColor(active, contrastForeActive, !darkTheme);
|
|
216
|
+
const containerActive = luminanceColor(container, Colors.luminance(container) + luminanceBackActiveOffset);
|
|
217
|
+
const containerActiveContrast = contrastColor(containerActive, contrastForeActive, darkTheme);
|
|
218
|
+
const emphasis = isDesaturated ? Colors.lighten(actualColor, .1) : Colors.saturate(actualColor, 1.2);
|
|
219
|
+
return {
|
|
220
|
+
base: actualColor,
|
|
221
|
+
contrast,
|
|
222
|
+
active,
|
|
223
|
+
activeContrast,
|
|
224
|
+
containerActive,
|
|
225
|
+
container,
|
|
226
|
+
emphasis,
|
|
227
|
+
containerActiveContrast,
|
|
228
|
+
containerContrast
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
const lessVariables = {};
|
|
232
|
+
const a255 = (x) => Math.round(x * 255);
|
|
233
|
+
const a255s = (c) => `${a255(c.r)}, ${a255(c.g)}, ${a255(c.b)}`;
|
|
234
|
+
const pushLessVariables = (name, mod) => {
|
|
235
|
+
lessVariables[`@color_${name}`] = Colors.stringify(mod.base);
|
|
236
|
+
lessVariables[`@color_${name}_rgb`] = a255s(mod.base);
|
|
237
|
+
lessVariables[`@color_${name}_inv`] = Colors.stringify(mod.contrast);
|
|
238
|
+
lessVariables[`@color_${name}_inv_rgb`] = a255s(mod.contrast);
|
|
239
|
+
lessVariables[`@color_${name}_container`] = Colors.stringify(mod.container);
|
|
240
|
+
lessVariables[`@color_${name}_container_rgb`] = a255s(mod.container);
|
|
241
|
+
lessVariables[`@color_${name}_container_inv`] = Colors.stringify(mod.containerContrast);
|
|
242
|
+
lessVariables[`@color_${name}_container_inv_rgb`] = a255s(mod.containerContrast);
|
|
243
|
+
lessVariables[`@color_${name}_active`] = Colors.stringify(mod.active);
|
|
244
|
+
lessVariables[`@color_${name}_active_rgb`] = a255s(mod.active);
|
|
245
|
+
lessVariables[`@color_${name}_active_inv`] = Colors.stringify(mod.activeContrast);
|
|
246
|
+
lessVariables[`@color_${name}_active_inv_rgb`] = a255s(mod.activeContrast);
|
|
247
|
+
lessVariables[`@color_${name}_container_active`] = Colors.stringify(mod.containerActive);
|
|
248
|
+
lessVariables[`@color_${name}_container_active_rgb`] = a255s(mod.containerActive);
|
|
249
|
+
lessVariables[`@color_${name}_container_active_inv`] = Colors.stringify(mod.containerActiveContrast);
|
|
250
|
+
lessVariables[`@color_${name}_container_active_inv_rgb`] = a255s(mod.containerActiveContrast);
|
|
251
|
+
lessVariables[`@color_${name}_emphasis`] = Colors.stringify(mod.emphasis);
|
|
252
|
+
lessVariables[`@color_${name}_emphasis_rgb`] = a255s(mod.emphasis);
|
|
253
|
+
};
|
|
254
|
+
const backgroundColor = Colors.parse(palette['background']);
|
|
255
|
+
backgroundModule = colorModuleBackground(backgroundColor, 'background');
|
|
256
|
+
pushLessVariables('background', backgroundModule);
|
|
257
|
+
const rootColor = 'root' in palette ? Colors.parse(palette['root']) : Colors.darken(backgroundModule.base, darkTheme ? .02 : .01);
|
|
258
|
+
rootModule = colorModuleBackground(rootColor, 'root');
|
|
259
|
+
pushLessVariables('root', rootModule);
|
|
260
|
+
if ('default' in palette) {
|
|
261
|
+
const defaultColor = contrastColor(Colors.parse(palette['default']), rootModule.base, WCAG_MAX_CONTRAST, darkTheme);
|
|
262
|
+
const defaultModule = colorModule(defaultColor, 'default');
|
|
263
|
+
pushLessVariables('default', defaultModule);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
pushLessVariables('default', invertModule(rootModule));
|
|
267
|
+
}
|
|
268
|
+
const disabledColor = ('disabled' in palette) ? Colors.parse(palette['disabled']) : backgroundModule.base;
|
|
269
|
+
pushLessVariables('disabled', colorModuleDisabled(disabledColor));
|
|
270
|
+
for (let name in palette) {
|
|
271
|
+
if (['default', 'background', 'root', 'disabled'].indexOf(name) >= 0) {
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
const color = Colors.parse(palette[name]);
|
|
275
|
+
const mod = colorModule(color, name);
|
|
276
|
+
pushLessVariables(name, mod);
|
|
277
|
+
}
|
|
278
|
+
if (!('invert' in palette)) {
|
|
279
|
+
pushLessVariables('invert', invertModule(backgroundModule));
|
|
280
|
+
}
|
|
281
|
+
let lessText = '@palette_prebuilt: true;\r\n';
|
|
282
|
+
for (let name in lessVariables) {
|
|
283
|
+
const hex = lessVariables[name];
|
|
284
|
+
lessText += `${name}: ${hex};\r\n`;
|
|
285
|
+
}
|
|
286
|
+
const target = argv.out ?? absolutePath('./pacem/palette-' + themeName + '.less');
|
|
287
|
+
if (!NullChecker.isNull(argv.void)) {
|
|
288
|
+
lessText = '';
|
|
289
|
+
}
|
|
290
|
+
fs.writeFileSync(target, lessText);
|