@nova-design-system/nova-base 3.29.0 → 3.31.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/README.md +25 -32
- package/assets/icons/icon-sprite.svg +1 -1
- package/dist/cjs/generated/nova-tailwind-tokens.js +45 -0
- package/dist/cjs/plugin/index.js +0 -1
- package/dist/cjs/plugin/nova-plugin.js +2 -100
- package/dist/cjs/plugin/typography.js +135 -0
- package/dist/css/nova-utils.css +26768 -24637
- package/dist/css/ocean.css +51 -8
- package/dist/css/spark.css +53 -10
- package/dist/generated/nova-tailwind-tokens.d.ts +45 -0
- package/dist/generated/nova-tailwind-tokens.js +45 -0
- package/dist/js/ocean_dark.d.ts +15 -0
- package/dist/js/ocean_dark.js +26 -11
- package/dist/js/ocean_light.d.ts +15 -0
- package/dist/js/ocean_light.js +17 -2
- package/dist/js/spacings.d.ts +14 -1
- package/dist/js/spacings.js +14 -1
- package/dist/js/spark_dark.d.ts +15 -0
- package/dist/js/spark_dark.js +29 -14
- package/dist/js/spark_light.d.ts +15 -0
- package/dist/js/spark_light.js +17 -2
- package/dist/plugin/index.d.ts +0 -1
- package/dist/plugin/index.js +0 -1
- package/dist/plugin/nova-plugin.d.ts +2 -4
- package/dist/plugin/nova-plugin.js +2 -99
- package/dist/plugin/typography.d.ts +79 -0
- package/dist/plugin/typography.js +127 -0
- package/generated/figma-to-tailwind-mapping.json +197 -17
- package/generated/nova-tailwind-tokens.ts +45 -0
- package/package.json +6 -3
- package/dist/cjs/plugin/nova-safelist.js +0 -341
- package/dist/plugin/nova-safelist.d.ts +0 -26
- package/dist/plugin/nova-safelist.js +0 -355
package/README.md
CHANGED
|
@@ -36,54 +36,47 @@ Include the tokens CSS in your project (two themes are available: Spark and Ocea
|
|
|
36
36
|
@import '@nova-design-system/nova-base/dist/css/ocean.css';
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
### Recommended Approach: Using Tailwind CSS with Nova Theme and Plugin
|
|
39
|
+
### Recommended Approach: Using Tailwind CSS v4 with Nova Theme and Plugin
|
|
40
40
|
|
|
41
|
-
The recommended approach is to set up Tailwind CSS and use
|
|
41
|
+
The recommended approach is to set up Tailwind CSS v4 and use the Nova theme and plugin via CSS directives. This method provides a smaller CSS bundle and access to more utilities than the precompiled CSS.
|
|
42
42
|
|
|
43
43
|
#### Prerequisites
|
|
44
44
|
|
|
45
|
-
Ensure that Tailwind CSS is installed in your project. If not, you can install it by following the [Tailwind CSS installation guide](https://tailwindcss.com/docs/installation).
|
|
45
|
+
Ensure that Tailwind CSS v4 is installed in your project. If not, you can install it by following the [Tailwind CSS installation guide](https://tailwindcss.com/docs/installation).
|
|
46
46
|
|
|
47
|
-
####
|
|
47
|
+
#### CSS Configuration
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Tailwind CSS v4 uses a CSS-first configuration. In your main CSS file, import Tailwind and configure the Nova plugin and theme:
|
|
50
50
|
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} from '@nova-design-system/nova-base/theme';
|
|
56
|
-
|
|
57
|
-
/** @type {import('tailwindcss').Config} */
|
|
58
|
-
export default {
|
|
59
|
-
// ...
|
|
60
|
-
theme: novaTailwindTheme,
|
|
61
|
-
plugins: [novaTailwindPlugin],
|
|
62
|
-
};
|
|
63
|
-
```
|
|
51
|
+
```css
|
|
52
|
+
/* Import the theme tokens */
|
|
53
|
+
@import '@nova-design-system/nova-base/dist/css/spark.css';
|
|
54
|
+
/* Or: @import '@nova-design-system/nova-base/dist/css/ocean.css'; */
|
|
64
55
|
|
|
65
|
-
|
|
56
|
+
@import "tailwindcss";
|
|
66
57
|
|
|
67
|
-
|
|
58
|
+
@plugin "@nova-design-system/nova-base/theme/plugin";
|
|
59
|
+
@config "./tailwind.config.ts";
|
|
60
|
+
```
|
|
68
61
|
|
|
69
|
-
|
|
62
|
+
Then create a minimal `tailwind.config.ts` with the Nova theme:
|
|
70
63
|
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
```ts
|
|
65
|
+
import type { Config } from 'tailwindcss';
|
|
66
|
+
import { novaTailwindTheme } from '@nova-design-system/nova-base/theme';
|
|
74
67
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
@tailwind utilities;
|
|
68
|
+
const config: Config = {
|
|
69
|
+
theme: novaTailwindTheme,
|
|
70
|
+
};
|
|
79
71
|
|
|
80
|
-
|
|
81
|
-
/* @import '@nova-design-system/nova-base/dist/css/ocean.css'; */
|
|
72
|
+
export default config;
|
|
82
73
|
```
|
|
83
74
|
|
|
75
|
+
The `novaTailwindTheme` maps Nova CSS variable tokens to Tailwind utilities. The `novaTailwindPlugin` (loaded via `@plugin`) adds base styles, components, and custom utilities like `text-high`, `bg-level-00`, and typography classes.
|
|
76
|
+
|
|
84
77
|
#### Benefits of Using Tailwind CSS with Nova Theme and Plugin
|
|
85
78
|
|
|
86
|
-
- **Smaller CSS Bundle:**
|
|
79
|
+
- **Smaller CSS Bundle:** Tailwind CSS v4 only generates CSS for classes actually used in your source files, resulting in a significantly smaller output.
|
|
87
80
|
- **More Utilities:** Gain access to a wider range of utilities beyond those included in the precompiled CSS.
|
|
88
81
|
- **Customization:** Tailwind CSS allows you to customize and extend your styles as needed.
|
|
89
82
|
|
|
@@ -97,4 +90,4 @@ import '@nova-design-system/nova-base/dist/css/spark.css';
|
|
|
97
90
|
import '@nova-design-system/nova-base/dist/css/nova-utils.css';
|
|
98
91
|
```
|
|
99
92
|
|
|
100
|
-
**Note:** The precompiled CSS includes a
|
|
93
|
+
**Note:** The precompiled CSS includes a broad set of pre-generated Tailwind utility classes and is quite large. This approach is only recommended if you cannot set up Tailwind CSS yourself.
|