1
- # @phntms /css-components
1
+ # @phantomstudios /css-components
2
2
3
3
[ ![ NPM version] [ npm-image ]] [ npm-url ]
4
4
[ ![ Actions Status] [ ci-image ]] [ ci-url ]
@@ -13,7 +13,7 @@ At its core, css-components is a simple wrapper around standard CSS. It allows y
13
13
Here is a minimal example of a button component with an optional variant:
14
14
15
15
``` ts
16
- import { styled } from " @phntms /css-components" ;
16
+ import { styled } from " @phantomstudios /css-components" ;
17
17
import css from " ./styles.module.css" ;
18
18
19
19
export const Button = styled (" button" , {
@@ -44,7 +44,7 @@ export const App = () => (
44
44
Install this package with ` npm ` .
45
45
46
46
``` bash
47
- npm i @phntms /css-components
47
+ npm i @phantomstudios /css-components
48
48
```
49
49
50
50
## Usage
@@ -67,7 +67,7 @@ components/Button/styles.module.css
67
67
components/Button/styles.ts
68
68
69
69
``` ts
70
- import { styled } from " @phntms /css-components" ;
70
+ import { styled } from " @phantomstudios /css-components" ;
71
71
import css from " ./styles.module.css" ;
72
72
73
73
export const StyledButton = styled (" button" , {
@@ -181,7 +181,7 @@ const StyledButton = styled("button", {
181
181
Wherever you specify a css selector, you can also pass in an array of classes to help composing and reusing styles.
182
182
183
183
``` tsx
184
- import { styled } from " @phntms /css-components" ;
184
+ import { styled } from " @phantomstudios /css-components" ;
185
185
import shared from " ../sharedstyles.module.css" ;
186
186
import css from " ./styles.module.css" ;
187
187
@@ -202,7 +202,7 @@ You can also style other components from other ecosystems. As long as the compon
202
202
Example extending the standard Next.js ` Link ` component:
203
203
204
204
``` tsx
205
- import { styled } from " @phntms /css-components" ;
205
+ import { styled } from " @phantomstudios /css-components" ;
206
206
import NextLink from " next/link" ;
207
207
import css from " ./styles.module.css" ;
208
208
@@ -223,7 +223,7 @@ By default variant values do not end up propagating to the element it is extendi
223
223
In the following example, ` readOnly ` is an intrinsic HTML attribute that we both want to style, but also continue to pass through to the DOM element.
224
224
225
225
``` tsx
226
- import { styled } from " @phntms /css-components" ;
226
+ import { styled } from " @phantomstudios /css-components" ;
227
227
import css from " ./styles.module.css" ;
228
228
229
229
const Input = styled (" input" , {
@@ -242,7 +242,7 @@ const Input = styled("input", {
242
242
We have included a helper that allows you to access the types of the variants you have defined.
243
243
244
244
``` tsx
245
- import { VariantProps } from " @phntms /css-components" ;
245
+ import { VariantProps } from " @phantomstudios /css-components" ;
246
246
import css from " ./styles.module.css" ;
247
247
248
248
const Button = styled (" button" , {
@@ -298,10 +298,10 @@ You can generate a component from this files with the following command:
298
298
299
299
``` bash
300
300
# For CSS
301
- npx @phntms /css-components --css styles.module.css
301
+ npx @phantomstudios /css-components --css styles.module.css
302
302
303
303
# For SCSS
304
- npx @phntms /css-components --css styles.module.scss
304
+ npx @phantomstudios /css-components --css styles.module.scss
305
305
306
306
# or if you have the package installed
307
307
npx css-components --css styles.module.css
@@ -311,7 +311,7 @@ npx css-components --css styles.module.scss
311
311
This will output a file called ` styles.ts ` that looks like this:
312
312
313
313
``` ts
314
- import { styled } from " @phntms /css-components" ;
314
+ import { styled } from " @phantomstudios /css-components" ;
315
315
316
316
import css from " ./test.css" ;
317
317
@@ -342,18 +342,18 @@ Example to generate components from all CSS and SCSS files in the components dir
342
342
343
343
``` bash
344
344
# From CSS
345
- npx @phntms /css-components --css ./src/components/** /* .css --output styles.ts
345
+ npx @phantomstudios /css-components --css ./src/components/** /* .css --output styles.ts
346
346
347
347
# Or from SCSS
348
- npx @phntms /css-components --css ./src/components/** /* .scss --output styles.ts
348
+ npx @phantomstudios /css-components --css ./src/components/** /* .scss --output styles.ts
349
349
350
350
# Or from both CSS and SCSS
351
- npx @phntms /css-components --css ./src/components/** /* .{css,scss} --output styles.ts
351
+ npx @phantomstudios /css-components --css ./src/components/** /* .{css,scss} --output styles.ts
352
352
```
353
353
354
- [ npm-image ] : https://img.shields.io/npm/v/@phntms /css-components.svg?style=flat-square&logo=react
355
- [ npm-url ] : https://npmjs.org/package/@phntms /css-components
356
- [ npm-downloads-image ] : https://img.shields.io/npm/dm/@phntms /css-components.svg
357
- [ npm-downloads-url ] : https://npmcharts.com/compare/@phntms /css-components?minimal=true
354
+ [ npm-image ] : https://img.shields.io/npm/v/@phantomstudios /css-components.svg?style=flat-square&logo=react
355
+ [ npm-url ] : https://npmjs.org/package/@phantomstudios /css-components
356
+ [ npm-downloads-image ] : https://img.shields.io/npm/dm/@phantomstudios /css-components.svg
357
+ [ npm-downloads-url ] : https://npmcharts.com/compare/@phantomstudios /css-components?minimal=true
358
358
[ ci-image ] : https://github.com/phantomstudios/css-components/workflows/test/badge.svg
359
359
[ ci-url ] : https://github.com/phantomstudios/css-components/actions
0 commit comments