@navita/vite-plugin 0.0.5 β 0.0.7
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 +157 -0
- package/package.json +10 -4
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
Navita is a powerful CSS-in-JS library
|
|
4
|
+
that brings type-safe compile-time Atomic CSS-in-JS with zero runtime to your projects.
|
|
5
|
+
|
|
6
|
+
It allows you to easily style your components and apply themes without the need for any additional runtime dependencies.
|
|
7
|
+
|
|
8
|
+
With Navita, you can write clean and maintainable CSS in JavaScript, without sacrificing runtime performance.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
π₯ All styles generated at build time β just like Sass, Less, etc.
|
|
12
|
+
|
|
13
|
+
β¨ Minimal abstraction over standard CSS.
|
|
14
|
+
|
|
15
|
+
π¦ Works with any JS-based front-end framework β or even without one.
|
|
16
|
+
|
|
17
|
+
π¨ High-level theme system with support for simultaneous themes.
|
|
18
|
+
|
|
19
|
+
πͺ Type-safe styles via [CSSType](https://github.com/frenic/csstype).
|
|
20
|
+
|
|
21
|
+
π³ Co-locate your styles with your components β if you want to.
|
|
22
|
+
|
|
23
|
+
π Integrations with popular bundlers such as Webpack, Vite, and Next.js.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
π [Check out the documentation site for setup guides, examples and API docs.](https://navita.style)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
To start using Navita in your project, simply follow these steps:
|
|
33
|
+
|
|
34
|
+
### Install Navita using npm:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install @navita/css --save
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
You'll also need to install the Navita integration for your preferred bundler.
|
|
41
|
+
Navita currently supports Webpack, Vite, and Next.js.
|
|
42
|
+
|
|
43
|
+
### Choose the integration for your preferred bundler:
|
|
44
|
+
#### If you are using Webpack, install the Webpack integration:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install @navita/webpack-plugin mini-css-extract-plugin --save-dev
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Update your `webpack.config.js` file to include both MiniCssExtractPlugin and NavitaPlugin:
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
const { NavitaPlugin } = require('@navita/webpack-plugin');
|
|
54
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
55
|
+
|
|
56
|
+
module.exports = {
|
|
57
|
+
// Other webpack options,
|
|
58
|
+
plugins: [
|
|
59
|
+
new MiniCssExtractPlugin(),
|
|
60
|
+
new NavitaPlugin(),
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Read more about the Webpack integration in the [Webpack documentation](https://navita.style/integrations/webpack).
|
|
66
|
+
|
|
67
|
+
#### If you are using Vite, install the Vite integration:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm install @navita/vite-plugin --save-dev
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
And add it to your `vite.config.js` file:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { defineConfig } from 'vite';
|
|
77
|
+
import { navita } from '@navita/vite-plugin';
|
|
78
|
+
|
|
79
|
+
export default defineConfig({
|
|
80
|
+
plugins: [
|
|
81
|
+
// Other plugins
|
|
82
|
+
navita(/* Additional options */)
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Read more about the Vite integration in the [Vite documentation](https://navita.style/integrations/vite).
|
|
88
|
+
|
|
89
|
+
##### If you are using Next.js, install the Next.js integration:
|
|
90
|
+
|
|
91
|
+
π React Server Components support!
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm install @navita/next-plugin --save-dev
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
And add it to your `next.config.js` file:
|
|
98
|
+
|
|
99
|
+
```javascript
|
|
100
|
+
const { createNavitaStylePlugin } = require("@navita/next-plugin");
|
|
101
|
+
|
|
102
|
+
/** @type {import('next').NextConfig} */
|
|
103
|
+
const nextConfig = {};
|
|
104
|
+
|
|
105
|
+
module.exports = createNavitaStylePlugin({
|
|
106
|
+
// Additional options
|
|
107
|
+
})(nextConfig);
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Read more about the Next.js integration in the [Next.js documentation](https://navita.style/integrations/next).
|
|
111
|
+
|
|
112
|
+
## Usage
|
|
113
|
+
|
|
114
|
+
The main entry point for Navita is the `style` function.
|
|
115
|
+
Make sure you read the reset of the documentation on
|
|
116
|
+
<https://navita.style> to learn more about the APIs.
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import { style } from '@navita/css';
|
|
120
|
+
|
|
121
|
+
const container = style({
|
|
122
|
+
padding: '2rem',
|
|
123
|
+
background: 'hotpink',
|
|
124
|
+
color: 'white',
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
document.write(`
|
|
128
|
+
<div class="${container}">
|
|
129
|
+
Hello World!
|
|
130
|
+
</div>
|
|
131
|
+
`);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
That's it!
|
|
135
|
+
|
|
136
|
+
π‘ Only references to the classNames will be included in the bundle.
|
|
137
|
+
|
|
138
|
+
> Note: Navita doesn't require special file extensions for your styles.
|
|
139
|
+
You can co-locate your CSS styles with your components.
|
|
140
|
+
|
|
141
|
+
## Documentation
|
|
142
|
+
|
|
143
|
+
For detailed documentation, examples, and usage guidelines,
|
|
144
|
+
please visit the official Navita website: <https://navita.style>
|
|
145
|
+
|
|
146
|
+
## Contributing
|
|
147
|
+
|
|
148
|
+
We welcome contributions from the community to make Navita even better!
|
|
149
|
+
|
|
150
|
+
## Thanks
|
|
151
|
+
* [Vanilla-Extract](https://vanilla-extract.style) and [Linaria](https://linaria.dev) for the inspiration and the great work on the CSS-in-JS ecosystem.
|
|
152
|
+
* [Fela](https://fela.js.org) for the fantastic work on Atomic css-in-js.
|
|
153
|
+
* [Eagerpatch](https://eagerpatch.com) for giving us the space to do interesting work.
|
|
154
|
+
***
|
|
155
|
+
|
|
156
|
+
MIT LicensedβA project by [Eagerpatch](https://eagerpatch.com).\
|
|
157
|
+
Made with β€οΈ by [zn4rk](https://github.com/zn4rk) and contributors.
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navita/vite-plugin",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"license": "MIT",
|
|
3
|
+
"version": "0.0.7",
|
|
5
4
|
"private": false,
|
|
6
5
|
"sideEffects": false,
|
|
7
6
|
"exports": {
|
|
@@ -12,7 +11,14 @@
|
|
|
12
11
|
}
|
|
13
12
|
},
|
|
14
13
|
"dependencies": {
|
|
15
|
-
"@navita/core": "0.0.
|
|
16
|
-
"@navita/css": "0.0.
|
|
14
|
+
"@navita/core": "0.0.7",
|
|
15
|
+
"@navita/css": "0.0.7"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "Eagerpatch",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/eagerpatch/navita.git",
|
|
22
|
+
"directory": "packages/vite-plugin"
|
|
17
23
|
}
|
|
18
24
|
}
|