@ng-native/tailwind 0.9.0 → 0.11.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/flatten.cjs +2 -1
- package/package.json +3 -3
- package/shared.css +6 -5
- package/tailwind-3-preset.cjs +7 -1
package/flatten.cjs
CHANGED
|
@@ -752,7 +752,8 @@ function hslChannels(h, s, l) {
|
|
|
752
752
|
if (u < 2 / 3) return p + (q - p) * (2 / 3 - u) * 6;
|
|
753
753
|
return p;
|
|
754
754
|
};
|
|
755
|
-
|
|
755
|
+
// A channel on a half, 127.5, is a hair under it in floating point: the hair goes first.
|
|
756
|
+
return [hue + 1 / 3, hue, hue - 1 / 3].map((t) => Math.round(+(channel(t) * 255).toFixed(10)));
|
|
756
757
|
}
|
|
757
758
|
|
|
758
759
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-native/tailwind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Tailwind CSS preset for Angular Native: Tailwind 4 and Tailwind 3, on native and on the web.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"type": "commonjs",
|
|
18
18
|
"main": "flatten.cjs",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ng-native/metro": "0.
|
|
20
|
+
"@ng-native/metro": "0.11.0",
|
|
21
21
|
"lightningcss": "^1.30.2"
|
|
22
22
|
},
|
|
23
23
|
"nx": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "https://github.com/ng-native/ng-native/issues"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@ng-native/metro": "0.
|
|
35
|
+
"@ng-native/metro": "0.11.0",
|
|
36
36
|
"@tailwindcss/cli": "^4.3.3",
|
|
37
37
|
"tailwindcss": "^3.4.1 || ^4.3.3"
|
|
38
38
|
},
|
package/shared.css
CHANGED
|
@@ -50,17 +50,18 @@
|
|
|
50
50
|
* Tailwind's own `dark:` is `@media (prefers-color-scheme: dark)`, which the engine answers and
|
|
51
51
|
* keeps in step with the system. That is one variant short of what a theme needs: a design system
|
|
52
52
|
* ships its dark palette as `.dark { --background: ... }`, and an app wants a switcher that can
|
|
53
|
-
* disagree with the OS. A class does both - put `dark` on the root and
|
|
54
|
-
*
|
|
53
|
+
* disagree with the OS. A class does both - put `dark` on the root and it flips, along with
|
|
54
|
+
* everything beneath it, whatever the system thinks.
|
|
55
55
|
*
|
|
56
56
|
* Bind it from `ColorScheme` and the default behaviour is unchanged:
|
|
57
57
|
*
|
|
58
58
|
* <view [class]="scheme.colorScheme()" style="flex: 1">
|
|
59
59
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
60
|
+
* Tailwind's own class-based form, so the view wearing `dark` matches as well as everything inside
|
|
61
|
+
* it, at the same specificity as on the web. The compiler reads the list as two rules, the view
|
|
62
|
+
* itself and an ancestor test.
|
|
62
63
|
*/
|
|
63
|
-
@custom-variant dark (.dark
|
|
64
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
64
65
|
|
|
65
66
|
/*
|
|
66
67
|
* The safe area, as utilities.
|
package/tailwind-3-preset.cjs
CHANGED
|
@@ -68,6 +68,12 @@ const STATES = {
|
|
|
68
68
|
*/
|
|
69
69
|
const beneath = (platform, name) => (platform === 'web' ? `[class~="${name}"] &` : `.${name} &`);
|
|
70
70
|
|
|
71
|
+
/** The same, but matching the element wearing the class too: Tailwind's `&:where(.x, .x *)`. */
|
|
72
|
+
const selfOrBeneath = (platform, name) => {
|
|
73
|
+
const root = platform === 'web' ? `[class~="${name}"]` : `.${name}`;
|
|
74
|
+
return `&:where(${root}, ${root} *)`;
|
|
75
|
+
};
|
|
76
|
+
|
|
71
77
|
/** `web.css`'s root tokens: the browser's own safe-area insets, and a hairline per density. */
|
|
72
78
|
const WEB_BASE = {
|
|
73
79
|
':root': Object.fromEntries(
|
|
@@ -182,7 +188,7 @@ function presetPlugin(
|
|
|
182
188
|
function tailwind3Preset(platform) {
|
|
183
189
|
return {
|
|
184
190
|
// A class seeded from the OS, so an app can disagree with it.
|
|
185
|
-
darkMode: ['variant',
|
|
191
|
+
darkMode: ['variant', selfOrBeneath(platform, 'dark')],
|
|
186
192
|
// A browser reset in terms of `html` and `::before`. None of it means anything on a phone, and
|
|
187
193
|
// in a browser the host's `reset.css` is the reset.
|
|
188
194
|
corePlugins: { preflight: false },
|