@decantr/css 1.0.0 → 1.0.2
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/README.md +2 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.js +37 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,6 +119,7 @@ Mobile-first breakpoints: `_sm:` (640px), `_md:` (768px), `_lg:` (1024px), `_xl:
|
|
|
119
119
|
When you scaffold a project with `@decantr/cli`, it generates:
|
|
120
120
|
|
|
121
121
|
- `src/styles/tokens.css` - Theme tokens (colors, spacing, radii)
|
|
122
|
+
- `src/styles/treatments.css` - Visual treatment classes (interactive, surface, data, control, section, annotation)
|
|
122
123
|
- `src/styles/decorators.css` - Recipe decorator classes
|
|
123
124
|
|
|
124
125
|
Import these alongside @decantr/css:
|
|
@@ -126,6 +127,7 @@ Import these alongside @decantr/css:
|
|
|
126
127
|
```js
|
|
127
128
|
import { css } from '@decantr/css';
|
|
128
129
|
import './styles/tokens.css';
|
|
130
|
+
import './styles/treatments.css';
|
|
129
131
|
import './styles/decorators.css';
|
|
130
132
|
```
|
|
131
133
|
|
package/dist/index.d.ts
CHANGED
|
@@ -75,9 +75,9 @@ declare function injectMediaQuery(className: string, declaration: string, query:
|
|
|
75
75
|
*/
|
|
76
76
|
declare function extractCSS(): string;
|
|
77
77
|
/**
|
|
78
|
-
* Get
|
|
78
|
+
* Get array of injected class names.
|
|
79
79
|
*/
|
|
80
|
-
declare function getInjectedClasses():
|
|
80
|
+
declare function getInjectedClasses(): string[];
|
|
81
81
|
/**
|
|
82
82
|
* Reset all injected styles (for testing).
|
|
83
83
|
*/
|
|
@@ -94,4 +94,9 @@ declare function reset(): void;
|
|
|
94
94
|
*/
|
|
95
95
|
declare function resolveAtomDecl(atom: string): string | null;
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
declare function getAnimations(): boolean;
|
|
98
|
+
declare function setAnimations(v: boolean): void;
|
|
99
|
+
declare function getTheme(): string | null;
|
|
100
|
+
declare function setTheme(id: string | null): void;
|
|
101
|
+
|
|
102
|
+
export { BREAKPOINTS, CQ_WIDTHS, css, define, extractCSS, getAnimations, getInjectedClasses, getTheme, inject, injectContainer, injectGroupPeer, injectMediaQuery, injectPseudo, injectResponsive, reset, resolveAtomDecl, setAnimations, setTheme };
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,8 @@ var DIRECT = {
|
|
|
77
77
|
minh0: "min-height:0",
|
|
78
78
|
maxwfull: "max-width:100%",
|
|
79
79
|
maxhfull: "max-height:100%",
|
|
80
|
+
mw640: "max-width:40rem",
|
|
81
|
+
mw480: "max-width:30rem",
|
|
80
82
|
// Overflow
|
|
81
83
|
overhidden: "overflow:hidden",
|
|
82
84
|
overauto: "overflow:auto",
|
|
@@ -104,6 +106,8 @@ var DIRECT = {
|
|
|
104
106
|
fontsemi: "font-weight:600",
|
|
105
107
|
fontbold: "font-weight:700",
|
|
106
108
|
fontextrabold: "font-weight:800",
|
|
109
|
+
// Font family
|
|
110
|
+
fontmono: "font-family:var(--d-font-mono,ui-monospace,monospace)",
|
|
107
111
|
// Font style
|
|
108
112
|
italic: "font-style:italic",
|
|
109
113
|
notitalic: "font-style:normal",
|
|
@@ -232,8 +236,15 @@ var DIRECT = {
|
|
|
232
236
|
ring: "outline:2px solid var(--d-primary,#6366f1);outline-offset:2px",
|
|
233
237
|
ring1: "outline:1px solid var(--d-primary,#6366f1);outline-offset:1px",
|
|
234
238
|
ring2: "outline:2px solid var(--d-primary,#6366f1);outline-offset:2px",
|
|
235
|
-
// Container
|
|
236
|
-
|
|
239
|
+
// Container queries
|
|
240
|
+
cqinline: "container-type:inline-size",
|
|
241
|
+
// Container (max-width containment)
|
|
242
|
+
container: "max-width:1200px;margin-inline:auto;width:100%;padding-inline:1rem",
|
|
243
|
+
containersm: "max-width:640px;margin-inline:auto;width:100%;padding-inline:1rem",
|
|
244
|
+
containermd: "max-width:768px;margin-inline:auto;width:100%;padding-inline:1rem",
|
|
245
|
+
containerlg: "max-width:1024px;margin-inline:auto;width:100%;padding-inline:1rem",
|
|
246
|
+
containerxl: "max-width:1400px;margin-inline:auto;width:100%;padding-inline:1rem",
|
|
247
|
+
containerfull: "max-width:100%;margin-inline:auto;width:100%;padding-inline:1rem",
|
|
237
248
|
// Background
|
|
238
249
|
bgcover: "background-size:cover",
|
|
239
250
|
bgcontain: "background-size:contain",
|
|
@@ -334,6 +345,8 @@ var COLOR_ATOMS = {
|
|
|
334
345
|
bgsurface0: "background:var(--d-surface-0,var(--d-bg))",
|
|
335
346
|
bgsurface1: "background:var(--d-surface-1,var(--d-surface))",
|
|
336
347
|
bgsurface2: "background:var(--d-surface-2,var(--d-surface-raised))",
|
|
348
|
+
bgsurf: "background:var(--d-surface)",
|
|
349
|
+
bgsurfraised: "background:var(--d-surface-raised)",
|
|
337
350
|
bgmuted: "background:var(--d-muted,var(--d-surface))",
|
|
338
351
|
bgbg: "background:var(--d-bg)",
|
|
339
352
|
bgtransparent: "background:transparent",
|
|
@@ -753,7 +766,7 @@ function extractCSS() {
|
|
|
753
766
|
return css2;
|
|
754
767
|
}
|
|
755
768
|
function getInjectedClasses() {
|
|
756
|
-
return
|
|
769
|
+
return [...injected];
|
|
757
770
|
}
|
|
758
771
|
function reset() {
|
|
759
772
|
injected.clear();
|
|
@@ -996,13 +1009,31 @@ function css(...classes) {
|
|
|
996
1009
|
function define(name, declaration) {
|
|
997
1010
|
customAtoms.set(name, declaration);
|
|
998
1011
|
}
|
|
1012
|
+
|
|
1013
|
+
// src/index.ts
|
|
1014
|
+
var _animations = true;
|
|
1015
|
+
function getAnimations() {
|
|
1016
|
+
return _animations;
|
|
1017
|
+
}
|
|
1018
|
+
function setAnimations(v) {
|
|
1019
|
+
_animations = v;
|
|
1020
|
+
}
|
|
1021
|
+
var _themeId = null;
|
|
1022
|
+
function getTheme() {
|
|
1023
|
+
return _themeId;
|
|
1024
|
+
}
|
|
1025
|
+
function setTheme(id) {
|
|
1026
|
+
_themeId = id;
|
|
1027
|
+
}
|
|
999
1028
|
export {
|
|
1000
1029
|
BREAKPOINTS,
|
|
1001
1030
|
CQ_WIDTHS,
|
|
1002
1031
|
css,
|
|
1003
1032
|
define,
|
|
1004
1033
|
extractCSS,
|
|
1034
|
+
getAnimations,
|
|
1005
1035
|
getInjectedClasses,
|
|
1036
|
+
getTheme,
|
|
1006
1037
|
inject,
|
|
1007
1038
|
injectContainer,
|
|
1008
1039
|
injectGroupPeer,
|
|
@@ -1010,5 +1041,7 @@ export {
|
|
|
1010
1041
|
injectPseudo,
|
|
1011
1042
|
injectResponsive,
|
|
1012
1043
|
reset,
|
|
1013
|
-
resolveAtomDecl
|
|
1044
|
+
resolveAtomDecl,
|
|
1045
|
+
setAnimations,
|
|
1046
|
+
setTheme
|
|
1014
1047
|
};
|