@pacem/pacem-theme-css 0.0.0-stage → 1.1.0-sierpinski
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 +142 -3
- package/pacem-themes.json +10 -0
- package/package.json +45 -6
- package/src/2d/index.css +44 -0
- package/src/3d/index.css +49 -0
- package/src/base/animations.css +82 -0
- package/src/base/attributes.css +19 -0
- package/src/base/backgrounds.css +37 -0
- package/src/base/body.css +199 -0
- package/src/base/content.css +4 -0
- package/src/base/icons.css +74 -0
- package/src/base/logging.css +5 -0
- package/src/base/overrides.css +3 -0
- package/src/base/preloader.css +17 -0
- package/src/base/reset.css +50 -0
- package/src/base/shell.css +3 -0
- package/src/base/text.css +184 -0
- package/src/basic/index.css +285 -0
- package/src/charts/generated/colors.css +49 -0
- package/src/charts/index.css +573 -0
- package/src/fx/index.css +230 -0
- package/src/layout/address.css +46 -0
- package/src/layout/animations.css +33 -0
- package/src/layout/borders.css +63 -0
- package/src/layout/box.css +271 -0
- package/src/layout/breadcrumbs.css +114 -0
- package/src/layout/cards.css +246 -0
- package/src/layout/coloring.css +862 -0
- package/src/layout/container.css +40 -0
- package/src/layout/corners.css +52 -0
- package/src/layout/datatable.css +324 -0
- package/src/layout/elevation.css +73 -0
- package/src/layout/fetch-feedback.css +125 -0
- package/src/layout/generated/borders.css +403 -0
- package/src/layout/generated/card-ribbon.css +94 -0
- package/src/layout/generated/card-sides.css +888 -0
- package/src/layout/generated/grid-system.css +308 -0
- package/src/layout/generated/grids.css +952 -0
- package/src/layout/generated/layout-stretch.css +132 -0
- package/src/layout/generated/positioning.css +323 -0
- package/src/layout/generated/sizing.css +478 -0
- package/src/layout/generated/spacing.css +1988 -0
- package/src/layout/generated/visibility.css +384 -0
- package/src/layout/grid-system.css +49 -0
- package/src/layout/grids.css +92 -0
- package/src/layout/index.css +39 -0
- package/src/layout/interactive.css +11 -0
- package/src/layout/layout.css +479 -0
- package/src/layout/lists.css +104 -0
- package/src/layout/other.css +25 -0
- package/src/layout/panels.css +337 -0
- package/src/layout/positioning.css +108 -0
- package/src/layout/scroll.css +85 -0
- package/src/layout/shapes.css +20 -0
- package/src/layout/shell.css +3 -0
- package/src/layout/sizing.css +25 -0
- package/src/layout/spacing.css +17 -0
- package/src/layout/superposition-system.css +116 -0
- package/src/layout/tokens-chips.css +15 -0
- package/src/layout/toolbar.css +30 -0
- package/src/layout/typography.css +106 -0
- package/src/layout/visibility.css +231 -0
- package/src/maps/index.css +20 -0
- package/src/media/index.css +6 -0
- package/src/media.css +18 -0
- package/src/pacem-content.css +24 -0
- package/src/pacem-shell.css +14 -0
- package/src/pacem.css +35 -0
- package/src/plus/carousel.css +327 -0
- package/src/plus/datagrid.css +68 -0
- package/src/plus/gallery.css +186 -0
- package/src/plus/icons.css +25 -0
- package/src/plus/index.css +7 -0
- package/src/plus/misc.css +194 -0
- package/src/scaffolding/calendar-picker.css +291 -0
- package/src/scaffolding/checkbox-radio.css +118 -0
- package/src/scaffolding/checkbox.css +200 -0
- package/src/scaffolding/childform.css +156 -0
- package/src/scaffolding/color.css +129 -0
- package/src/scaffolding/contenteditable.css +403 -0
- package/src/scaffolding/datepicker.css +126 -0
- package/src/scaffolding/elements.css +30 -0
- package/src/scaffolding/fieldset.css +346 -0
- package/src/scaffolding/form.css +36 -0
- package/src/scaffolding/formfield.css +364 -0
- package/src/scaffolding/generated/calendar-picker.css +40 -0
- package/src/scaffolding/generated/colors.css +115 -0
- package/src/scaffolding/generated/formfield.css +500 -0
- package/src/scaffolding/hierarchy.css +76 -0
- package/src/scaffolding/icons.css +64 -0
- package/src/scaffolding/image.css +195 -0
- package/src/scaffolding/index.css +40 -0
- package/src/scaffolding/input.css +163 -0
- package/src/scaffolding/inputs.css +77 -0
- package/src/scaffolding/latlng.css +173 -0
- package/src/scaffolding/markdown.css +14 -0
- package/src/scaffolding/password.css +7 -0
- package/src/scaffolding/pickers.css +150 -0
- package/src/scaffolding/radio.css +68 -0
- package/src/scaffolding/select.css +59 -0
- package/src/scaffolding/slider.css +236 -0
- package/src/scaffolding/snapshot.css +167 -0
- package/src/scaffolding/suggest.css +92 -0
- package/src/scaffolding/tags.css +132 -0
- package/src/scaffolding/textarea.css +45 -0
- package/src/scaffolding/upload.css +283 -0
- package/src/scaffolding/validators.css +29 -0
- package/src/tokens/colors.css +403 -0
- package/src/tokens/components.css +16 -0
- package/src/tokens/system.css +92 -0
- package/src/tokens/theme.css +221 -0
- package/src/traits.css +18 -0
- package/src/transforms/index.css +5 -0
- package/src/ui/anchor.css +55 -0
- package/src/ui/balloon.css +573 -0
- package/src/ui/binder.css +28 -0
- package/src/ui/blade.css +83 -0
- package/src/ui/bottom-sheet.css +53 -0
- package/src/ui/button.css +626 -0
- package/src/ui/calendar.css +415 -0
- package/src/ui/collapse.css +25 -0
- package/src/ui/dialog.css +230 -0
- package/src/ui/divider.css +42 -0
- package/src/ui/generated/calendar.css +363 -0
- package/src/ui/hidden.css +40 -0
- package/src/ui/icon.css +90 -0
- package/src/ui/image.css +140 -0
- package/src/ui/index.css +30 -0
- package/src/ui/led.css +84 -0
- package/src/ui/loader.css +174 -0
- package/src/ui/markdown.css +242 -0
- package/src/ui/marquee.css +41 -0
- package/src/ui/menu.css +386 -0
- package/src/ui/pager.css +133 -0
- package/src/ui/progressbar.css +137 -0
- package/src/ui/shell.css +4 -0
- package/src/ui/sidebar.css +103 -0
- package/src/ui/sticky-header.css +22 -0
- package/src/ui/tabs.css +355 -0
- package/src/ui/ticker.css +105 -0
- package/src/ui/timeline.css +106 -0
- package/src/ui/toast.css +182 -0
- package/src/ui/toc.css +58 -0
- package/src/ui/tuner.css +196 -0
- package/src/ui/view.css +30 -0
- package/src/ui/window.css +287 -0
- package/templates/theme.css +28 -0
- package/themes/dark.css +6 -0
- package/themes/light.css +97 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2023 Pacem sas (https://pacem.it)
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,142 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Pacem CSS
|
|
2
|
+
|
|
3
|
+
[Pacem JS](https://www.npmjs.com/package/@pacem/pacem) theme, written in native CSS. It uses cascade layers, `@property`, relative colors and `color-mix()`, with a Baseline 2025 target.
|
|
4
|
+
|
|
5
|
+
One stylesheet serves every theme. A theme is only a set of custom-property values, so switching is instant:
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<html light> <!-- or dark (the default), or data-theme="light" on any subtree -->
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
// every derived color (hover, container, inverse...) follows at once
|
|
13
|
+
document.documentElement.style.setProperty('--pacem-color-primary', '#ff0085');
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Your own themes
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
npm i -D @pacem/pacem-theme-css
|
|
20
|
+
npx pacem-theme-css init # pacem-themes.json, palette.json, theme.css
|
|
21
|
+
npx pacem-theme-css build # dist/css/theme[-shell|-content][.min].css
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`init` writes three files, which `build` turns into three bundles. Each bundle contains Pacem's styles, the tokens of every theme and your embedded css, whatever the number of themes: the themes switch at runtime (`<html light>`, `data-theme`), not by loading another file.
|
|
25
|
+
|
|
26
|
+
| Bundle | Contents | Was (Less) |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `{name}.css` | everything | `pacem-{theme}.min.css` |
|
|
29
|
+
| `{name}-shell.css` | reset, layout, loader, menu | `-shell` |
|
|
30
|
+
| `{name}-content.css` | everything else | `-content` |
|
|
31
|
+
|
|
32
|
+
### pacem-themes.json
|
|
33
|
+
|
|
34
|
+
```jsonc
|
|
35
|
+
{
|
|
36
|
+
"name": "acme", // bundle names: acme.css, acme-shell.css, acme-content.css (+ .min.css)
|
|
37
|
+
"out": "dist/css",
|
|
38
|
+
"palette": "palette.json", // 1. one palette, WCAG-adapted to each theme...
|
|
39
|
+
"contrast": { "default": 4.5, "min": 1.5, "max": 15 }, // ...to these targets (the defaults)
|
|
40
|
+
"themes": { // the first one is the default (or set "default")
|
|
41
|
+
"dark": {
|
|
42
|
+
"base": "dark",
|
|
43
|
+
"contrast": { "min": 2 } // targets of this theme only (over the shared ones)
|
|
44
|
+
},
|
|
45
|
+
"light": {
|
|
46
|
+
"base": "light",
|
|
47
|
+
"palette": "palette-light.json", // a palette of its own, WCAG-adapted the same way (false: runtime derivations)
|
|
48
|
+
"tokens": "light-tokens.css", // any --pacem-* override, for this theme only
|
|
49
|
+
"traits": { "shadows": true, "rounded": true } // 2. appearance
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"embed": ["theme.css"], // 3. embedded css (every theme): full and content bundles...
|
|
53
|
+
// "embed": { "shell": ["shell.css"], "content": ["theme.css"] }, ...or by bundle
|
|
54
|
+
"prefix": { "tag": "pacem", "class": "pacem" }, // <pacem-button>, .pacem-panel, --pacem-color-primary...
|
|
55
|
+
"emit": { "themes": false, "compat": false } // 4. extra outputs
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**1. Palette.** A palette is a JSON file of colors: `background`, `primary`, `secondary`, `accent`, `success`, `warning`, `error`, `danger`, `info`, `green` … `gray`, and optionally `root`, `default` and `disabled`. Missing colors keep their defaults (see the file `init` writes). For every color and theme, the build computes the base, `-inverse`, `-hover`, `-container`… variants to reach the target WCAG contrast ratios against the theme's background: light colors on dark backgrounds in dark themes (the `dark-scheme` trait), and the other way round. One palette therefore serves both a dark and a light theme. A theme can have its own palette, which is adapted in the same way.
|
|
60
|
+
|
|
61
|
+
The contrast targets (WCAG ratios, 1 to 21) are shared by every theme, and each theme can override any of them:
|
|
62
|
+
|
|
63
|
+
| `contrast` | Against the theme's background | Default |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| `default` | minimum contrast of the solid colors (`--pacem-color-primary`…) | 4.5 |
|
|
66
|
+
| `min` | minimum contrast of the containers (`--pacem-color-primary-container`…) | 1.5 |
|
|
67
|
+
| `max` | maximum contrast of the default (text) color | 15 |
|
|
68
|
+
|
|
69
|
+
**2. Traits.** Traits switch the appearance features that are on or off per theme. A theme starts from the traits of its `base`, and its `traits` override any of them:
|
|
70
|
+
|
|
71
|
+
| Trait | What it toggles | `dark` | `light` |
|
|
72
|
+
|---|---|:---:|:---:|
|
|
73
|
+
| `shadows` | drop shadows | ✓ | |
|
|
74
|
+
| `gradients` | glossy gradients | ✓ | |
|
|
75
|
+
| `glows` | glowing hovers | | |
|
|
76
|
+
| `blur` | backdrop blur | | |
|
|
77
|
+
| `dark-scheme` | dark color scheme, which also decides the palette adaptation | ✓ | |
|
|
78
|
+
| `field-underline` | underlined form fields, boxed otherwise | ✓ | |
|
|
79
|
+
| `field-outline` | focus outline on every form field (`--pacem-field-outline-width`), otherwise only on `.field-outline` ones | | |
|
|
80
|
+
|
|
81
|
+
(✓: on in that base; the bases are defined in `tools/config.ts`, `BASES`.) Any other name in `traits` is a custom trait, off unless a theme turns it on: use it in your css as `:--name` or `:--no-name`. `npx pacem-theme-css traits` lists them all, with the themes that have each one.
|
|
82
|
+
|
|
83
|
+
**A custom theme.** Any look can be built on a base: e.g. the former built-in *phousys* theme is now a customization of the Pacem JS webapp (`app/Pacem.JS.WebApp/client/theme`): base `dark`, a `tokens` file (fonts, colors, a dotted body background) and traits (`gradients`, `glows`, `blur` on, `shadows` off):
|
|
84
|
+
|
|
85
|
+
```jsonc
|
|
86
|
+
"phousys": { "base": "dark", "palette": false, "tokens": "phousys.css", "traits": { "shadows": false, "gradients": true, "glows": true, "blur": true } }
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**3. Embedded css.** The `embed` files are bundled in the `pacem.app` layer, so they override Pacem's rules without specificity fights, while your unlayered stylesheets still override everything. They serve every theme: what applies to some themes only is written with traits (`:--no-shadows .pacem-card { … }`) or with the theme attributes (`[light] .pacem-card { … }`); the token values of one theme go in its `tokens` file. Inside them you can use:
|
|
90
|
+
- tokens (`var(--pacem-color-primary)`; `npx pacem-theme-css tokens [--theme light]` lists them);
|
|
91
|
+
- traits;
|
|
92
|
+
- breakpoints (`@media (--pacem-md)`);
|
|
93
|
+
- native nesting;
|
|
94
|
+
- file-local `@custom-selector :--alias <selector>;`.
|
|
95
|
+
|
|
96
|
+
Write class and element names with the `pacem` prefix: the build applies the configured one.
|
|
97
|
+
|
|
98
|
+
**4. Extra outputs.** `emit.themes`: the non-default themes go to separate token files instead (`themes/{theme}.css`, and `themes/all.css`): the bundles then carry the default theme only, and pages load the other themes on demand. `emit.compat`: per-theme drop-in bundles named like the Less ones (`{name}-{theme}[-shell|-content].min.css`), each one carrying a single theme as its default.
|
|
99
|
+
|
|
100
|
+
### Runtime overrides
|
|
101
|
+
|
|
102
|
+
Without any build, any token can be overridden from the application's css (`:root { --pacem-color-primary: … }`) or from script. The derived colors follow. The legacy `-rgb` triplets are computed at build time and don't follow runtime overrides.
|
|
103
|
+
|
|
104
|
+
## How it works
|
|
105
|
+
|
|
106
|
+
### Tokens
|
|
107
|
+
- `src/tokens/theme.css`: the base variables, which are the dark ones.
|
|
108
|
+
- `themes/light.css`: the light base's overrides.
|
|
109
|
+
- `src/tokens/colors.css`: the color modules. Every semantic and palette color gets `-inverse`, `-hover`, `-emphasis-hover`, `-inverse-hover`, `-container[-hover]` and `-container-inverse[-hover]` variants, derived at runtime through `--pacem-mix-*`. A WCAG palette overrides them with tuned values. They are registered as `<color>`, so `getComputedStyle` returns resolved colors.
|
|
110
|
+
- `src/tokens/components.css`: component-level tokens (e.g. `--pacem-transform-heading`, `--pacem-transform-button`, `--pacem-transform-carousel`).
|
|
111
|
+
- Values that Less computed per theme in component files are tokens too, e.g. `--pacem-color-button-back-hover`, `--pacem-shadow-balloon`, `--pacem-contextmenu-hr-back` and `--pacem-contextmenu-hr-border`.
|
|
112
|
+
|
|
113
|
+
### Traits
|
|
114
|
+
A few rules exist only in some themes: Less switched them with compile-time guards (`@shadows`, `@gradients`, `@glows`…). Here they are zero-specificity root selectors, generated from the themes' traits (`tools/traits.ts`, `src/traits.css`):
|
|
115
|
+
|
|
116
|
+
```css
|
|
117
|
+
:--no-shadows .pacem-card > .card-heading { color: #fff; }
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Traits follow the root theme. A `[data-theme]` subtree switches the tokens, not the traits.
|
|
121
|
+
|
|
122
|
+
### Layers
|
|
123
|
+
`@layer pacem.tokens, pacem.styles, pacem.app`. All of Pacem's style rules share one layer, in the order of the Less theme, so their mutual cascade is unchanged.
|
|
124
|
+
|
|
125
|
+
### Sources
|
|
126
|
+
- `src/**/*.css`: hand-written, with native nesting.
|
|
127
|
+
- **Per-variant families** (`.text-{color}`, `.fill-{color}`, panel/card variants, datatable colors…): the rules are written once, against private custom properties (`--pacem--fill`, `--pacem--box`…). Each variant class only assigns them. The ones that must not leak to descendants are registered with `inherits: false`.
|
|
128
|
+
- **File-local aliases** (`@custom-selector :--name <selector>;`, expanded by `tools/traits.ts`). An alias wrapped in `:is()` is substituted as is. An alias whose value is a plain selector list (e.g. `:--btns .pacem-button, a.pacem-button, pacem-button` in `ui/button.css`) expands each selector using it into one selector per alternative, so that every form keeps its own specificity, as in the Less output. These list aliases go in flat rules only, since nesting under them would turn the parent into an `:is()` again.
|
|
129
|
+
- `src/**/generated/*.css`: the purely combinatorial utilities (responsive spacing, grid columns…). They come from `tools/generate.ts` and are committed; `generate.ts --check` fails when they are stale.
|
|
130
|
+
- `tools/compile.ts` (the compiler), `tools/config.ts` (configuration and bases), `tools/palette.ts` (WCAG palettes), `cli.ts` (bundled into `cli.js`) and `themebuilder.ts` (a standalone palette file, bundled into `themebuilder.js`).
|
|
131
|
+
|
|
132
|
+
### The package's own build
|
|
133
|
+
`pacem-themes.json` in this folder (themes dark and light, runtime derivations), built by `npm run build-css-native` from the monorepo root. Besides the bundles, it emits the non-default themes as separate files (`themes/*.css`) and per-theme drop-in bundles named like the Less ones (`pacem-{theme}[-shell|-content].min.css`).
|
|
134
|
+
|
|
135
|
+
### Tests (`npm run test-css-native`)
|
|
136
|
+
- The themes compared with the Less build: dark, light and *phousys*, kept as a test fixture (`test/fixtures`: a custom theme, base dark + tokens file + traits) since it is the only one with glows and blur.
|
|
137
|
+
- `test/tokens.ts`: every root token and `-rgb` triplet resolves to the same value as in the Less build.
|
|
138
|
+
- `test/diff.ts <folder>`: every class, element and attribute styled by Less is styled here too. Declarations not driven by private properties are compared one by one, per theme.
|
|
139
|
+
- `test/matrix.ts`: generated markup covering the class combinations, rendered with the Less build and with this one (3 themes, 2 widths). Every computed property of every element is compared.
|
|
140
|
+
- `test/compare.ts`: a pixel diff of a gallery page.
|
|
141
|
+
- `test/switch.ts`: runtime switching, JS overrides, `[data-theme]` subtrees, JS-readable tokens.
|
|
142
|
+
- `test/consumer.ts`: the consumer workflow through `cli.js` (shared palette and theme-level contrast, traits, tokens files, embedded css, prefixes).
|
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1.0-sierpinski",
|
|
3
|
+
"name": "@pacem/pacem-theme-css",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"homepage": "https://js.pacem.it",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/pacem-it/pacem.git"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"pacem-theme-css": "cli.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"src/**/*.css",
|
|
15
|
+
"themes/*.css",
|
|
16
|
+
"templates/*",
|
|
17
|
+
"pacem-themes.json",
|
|
18
|
+
"cli.js",
|
|
19
|
+
"themebuilder.js",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"NOTICE",
|
|
23
|
+
"package.json"
|
|
24
|
+
],
|
|
25
|
+
"author": {
|
|
26
|
+
"name": "Pacem",
|
|
27
|
+
"url": "https://pacem.it"
|
|
28
|
+
},
|
|
29
|
+
"maintainers": [
|
|
30
|
+
{
|
|
31
|
+
"name": "Cristian Merighi",
|
|
32
|
+
"url": "https://pacem.it"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"license": "Apache-2.0",
|
|
36
|
+
"description": "Pacem JS theme. Native CSS: cascade layers, custom properties, relative colors.",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"lightningcss": "^1.33.0",
|
|
39
|
+
"yargs": "^18.0.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@pacem/pacem-foundation": "*",
|
|
43
|
+
"@pacem/pacem-numerical": "*"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/2d/index.css
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* 2d (theme/less/pacem/2d): stage.less, text.less, then the non-visual elements. */
|
|
2
|
+
pacem-2d {
|
|
3
|
+
/* .StretchChildren() */
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: stretch;
|
|
6
|
+
align-content: stretch;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
|
|
9
|
+
> *,
|
|
10
|
+
&::part(container) {
|
|
11
|
+
flex: 1 0 auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
> :not(.pacem-2d) {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pacem-2d,
|
|
19
|
+
&::part(container) {
|
|
20
|
+
position: relative;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&::part(stage) {
|
|
24
|
+
display: block;
|
|
25
|
+
position: absolute;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pacem-2d > svg text {
|
|
29
|
+
fill: var(--pacem-color-default);
|
|
30
|
+
font-family: var(--pacem-font-std);
|
|
31
|
+
font-size: var(--pacem-font-size);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
pacem-2d-circle,
|
|
36
|
+
pacem-2d-path,
|
|
37
|
+
pacem-2d-rect,
|
|
38
|
+
pacem-2d-text,
|
|
39
|
+
pacem-2d-group,
|
|
40
|
+
pacem-2d-canvas-adapter,
|
|
41
|
+
pacem-2d-svg-adapter {
|
|
42
|
+
pointer-events: none !important;
|
|
43
|
+
display: none !important;
|
|
44
|
+
}
|
package/src/3d/index.css
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* 3d (theme/less/pacem/3d): stage.less, then the non-visual elements. */
|
|
2
|
+
pacem-3d {
|
|
3
|
+
/* stretchy flexbox */
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: stretch;
|
|
6
|
+
align-content: stretch;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
|
|
9
|
+
> * {
|
|
10
|
+
flex: 1 0 auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
> :not(.pacem-3d) {
|
|
14
|
+
pointer-events: none !important;
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pacem-3d {
|
|
19
|
+
position: relative;
|
|
20
|
+
|
|
21
|
+
> canvas {
|
|
22
|
+
display: block;
|
|
23
|
+
position: absolute;
|
|
24
|
+
image-rendering: crisp-edges;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pacem-3d-light,
|
|
30
|
+
pacem-3d-camera,
|
|
31
|
+
pacem-3d-object,
|
|
32
|
+
pacem-3d-mesh,
|
|
33
|
+
pacem-3d-group,
|
|
34
|
+
pacem-3d-primitive-sphere,
|
|
35
|
+
pacem-3d-primitive-cylinder,
|
|
36
|
+
pacem-3d-primitive-plane,
|
|
37
|
+
pacem-3d-primitive-torus,
|
|
38
|
+
pacem-3d-primitive-box,
|
|
39
|
+
pacem-3d-primitive-tetrahedron,
|
|
40
|
+
pacem-3d-primitive-hexahedron,
|
|
41
|
+
pacem-3d-primitive-octahedron,
|
|
42
|
+
pacem-3d-primitive-icosahedron,
|
|
43
|
+
pacem-3d-primitive-dodecahedron,
|
|
44
|
+
pacem-3d-three-adapter,
|
|
45
|
+
pacem-3d-wgsl-script,
|
|
46
|
+
pacem-3d-webgpu-adapter {
|
|
47
|
+
pointer-events: none !important;
|
|
48
|
+
display: none !important;
|
|
49
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
@keyframes core-anim {
|
|
2
|
+
0% { transform: translateY(calc(var(--pacem-grid-spacing) * 2)); }
|
|
3
|
+
100% { transform: none; }
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@keyframes default-anim {
|
|
7
|
+
0% { transform: translateY(calc(var(--pacem-grid-spacing) / 2)); opacity: 0; }
|
|
8
|
+
100% { opacity: 1; transform: none; }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@keyframes full-offset-rtl-anim {
|
|
12
|
+
0% { transform: translateX(100%); }
|
|
13
|
+
100% { transform: translateX(-100%); }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@keyframes full-offset-ltr-anim {
|
|
17
|
+
0% { transform: translateX(-100%); }
|
|
18
|
+
100% { transform: translateX(100%); }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes pop-anim {
|
|
22
|
+
0% { transform: scale(0, 0); }
|
|
23
|
+
100% { transform: none; }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* (rotate-anim: defined with the loader, in the shell css) */
|
|
27
|
+
|
|
28
|
+
@keyframes fade-in {
|
|
29
|
+
0% { opacity: 0; }
|
|
30
|
+
100% { opacity: 1; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@keyframes list-item {
|
|
34
|
+
0% { transform: translateY(calc(-1 * var(--pacem-grid-spacing))); opacity: 0; }
|
|
35
|
+
100% { opacity: 1; transform: none; }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@keyframes list-item-left {
|
|
39
|
+
0% { transform: translateX(calc(-1 * var(--pacem-grid-spacing))); opacity: 0; }
|
|
40
|
+
100% { opacity: 1; transform: none; }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes list-item-right {
|
|
44
|
+
0% { transform: translateX(var(--pacem-grid-spacing)); opacity: 0; }
|
|
45
|
+
100% { opacity: 1; transform: none; }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@keyframes list-item-bottom {
|
|
49
|
+
0% { transform: translateY(var(--pacem-grid-spacing)); opacity: 0; }
|
|
50
|
+
100% { opacity: 1; transform: none; }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes shooting-star {
|
|
54
|
+
0% { transform: translateY(calc(-1 * var(--pacem-grid-spacing))); opacity: 0; }
|
|
55
|
+
50% { opacity: 1; transform: translateY(0); }
|
|
56
|
+
100% { opacity: 0; transform: translateY(var(--pacem-grid-spacing)); }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@keyframes enhanced-anim {
|
|
60
|
+
0% { transform: translateY(var(--pacem-grid-spacing)) scaleY(1.5); opacity: 0; }
|
|
61
|
+
100% { opacity: 1; transform: none; }
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@keyframes alt-anim {
|
|
65
|
+
0% { transform: translateY(var(--pacem-grid-spacing)) scaleY(0.75); opacity: 0; }
|
|
66
|
+
100% { opacity: 1; transform: none; }
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@keyframes appear-anim {
|
|
70
|
+
0% { transform: scale(0.925); opacity: 0; }
|
|
71
|
+
100% { opacity: 1; transform: none; }
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@keyframes header-anim {
|
|
75
|
+
0% { transform: translateX(var(--pacem-grid-cell)); opacity: 0; }
|
|
76
|
+
100% { opacity: 1; transform: none; }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@keyframes bright-out {
|
|
80
|
+
0% { filter: brightness(5); }
|
|
81
|
+
100% { filter: brightness(1); }
|
|
82
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[pacem][cloak] {
|
|
2
|
+
visibility: hidden !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
[pacem][hidden] {
|
|
6
|
+
pointer-events: none !important;
|
|
7
|
+
display: none !important;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* lists */
|
|
11
|
+
ol, ul {
|
|
12
|
+
margin-top: 0;
|
|
13
|
+
margin-bottom: 1em;
|
|
14
|
+
padding: 0 0 0 calc(var(--pacem-grid-spacing) * 1.25);
|
|
15
|
+
|
|
16
|
+
ol, ul {
|
|
17
|
+
margin-bottom: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* .pacem-gloss and the .bg-{color} overrides (pacem.less).
|
|
2
|
+
.bg-{color} classes only assign --pacem--bg (background) and --pacem--bg-ink (foreground). */
|
|
3
|
+
|
|
4
|
+
.pacem-gloss {
|
|
5
|
+
/* .Gloss(#fff) */
|
|
6
|
+
:--gradients & {
|
|
7
|
+
background: linear-gradient(to bottom, rgb(255 255 255 / 0) 50%, rgb(255 255 255 / .4) 50%, rgb(255 255 255 / .1) 100%);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.bg-default { --pacem--bg: var(--pacem-color-background); --pacem--bg-ink: var(--pacem-color-default); }
|
|
12
|
+
.bg-error { --pacem--bg: var(--pacem-color-error); --pacem--bg-ink: var(--pacem-color-error-inverse); }
|
|
13
|
+
.bg-accent { --pacem--bg: var(--pacem-color-accent); --pacem--bg-ink: var(--pacem-color-accent-inverse); }
|
|
14
|
+
.bg-primary { --pacem--bg: var(--pacem-color-primary); --pacem--bg-ink: var(--pacem-color-primary-inverse); }
|
|
15
|
+
.bg-success { --pacem--bg: var(--pacem-color-success); --pacem--bg-ink: var(--pacem-color-success-inverse); }
|
|
16
|
+
.bg-warning { --pacem--bg: var(--pacem-color-warning); --pacem--bg-ink: var(--pacem-color-warning-inverse); }
|
|
17
|
+
.bg-danger { --pacem--bg: var(--pacem-color-danger); --pacem--bg-ink: var(--pacem-color-danger-inverse); }
|
|
18
|
+
.bg-invert { --pacem--bg: var(--pacem-color-default); --pacem--bg-ink: var(--pacem-color-default-inverse); }
|
|
19
|
+
.bg-disabled { --pacem--bg: var(--pacem-color-disabled); --pacem--bg-ink: var(--pacem-color-disabled-inverse); }
|
|
20
|
+
|
|
21
|
+
:is(.bg-default, .bg-error, .bg-accent, .bg-primary, .bg-success, .bg-warning, .bg-danger, .bg-invert, .bg-disabled) {
|
|
22
|
+
background-color: var(--pacem--bg);
|
|
23
|
+
color: var(--pacem--bg-ink);
|
|
24
|
+
|
|
25
|
+
&.pacem-gloss {
|
|
26
|
+
:--shadows & {
|
|
27
|
+
box-shadow: inset calc(var(--pacem-grid-spacing) / 12) 0 calc(var(--pacem-grid-spacing) / 12) var(--pacem--bg), inset calc(var(--pacem-grid-spacing) / -12) 0 calc(var(--pacem-grid-spacing) / 12) var(--pacem--bg);
|
|
28
|
+
text-shadow: 0 1px 0 var(--pacem--bg), 0 -1px 0 var(--pacem--bg), -1px 0 0 var(--pacem--bg), 1px 0 0 var(--pacem--bg);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* .Gloss(ink) */
|
|
32
|
+
:--gradients & {
|
|
33
|
+
background: linear-gradient(to bottom, rgb(from var(--pacem--bg-ink) r g b / 0) 50%, rgb(from var(--pacem--bg-ink) r g b / .4) 50%, rgb(from var(--pacem--bg-ink) r g b / .1) 100%);
|
|
34
|
+
background-color: var(--pacem--bg);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|