Skip to content

Commit bc191b1

Browse files
committed
docs(deprecation): deprecate postcss-rem-to-css-vars, use px-to-local-var instead
1 parent 8a98d0b commit bc191b1

1 file changed

Lines changed: 3 additions & 57 deletions

File tree

packages/postcss/README.md

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -19,62 +19,8 @@ pnpm add @cherrywind/postcss --save-dev
1919

2020
### postcss-rem-to-css-vars
2121

22-
A PostCSS plugin that converts rem units to calculations using CSS variables.
22+
now `postcss-rem-to-css-vars` is deprecated, use `px-to-local-var` instead.
2323

24-
#### Features
24+
### postcss-px-to-viewport
2525

26-
- ✨ Converts rem units to CSS variable calculations
27-
- 🚀 Lightweight implementation
28-
- 🔄 Seamless integration with modern frontend build tools
29-
30-
#### Usage
31-
32-
```js
33-
// postcss.config.js
34-
const { postcssRemToCssVars } = require('@cherrywind/postcss');
35-
36-
module.exports = {
37-
plugins: [
38-
postcssRemToCssVars({
39-
// Optional: customize CSS variable name
40-
varName: '--local-scope-rem'
41-
})
42-
]
43-
};
44-
```
45-
46-
#### CSS Transformation Examples
47-
48-
##### Before
49-
50-
```css
51-
.element {
52-
margin: 1rem;
53-
padding: 0.5rem 1.5rem;
54-
font-size: 0.875rem;
55-
border: 0.0625rem solid #ccc;
56-
width: calc(100% - 2rem);
57-
}
58-
```
59-
60-
##### After
61-
62-
```css
63-
.element {
64-
margin: calc(var(--local-scope-rem, 1rem) * 1);
65-
padding: calc(var(--local-scope-rem, 1rem) * 0.5) calc(var(--local-scope-rem, 1rem) * 1.5);
66-
font-size: calc(var(--local-scope-rem, 1rem) * 0.875);
67-
border: calc(var(--local-scope-rem, 1rem) * 0.0625) solid #ccc;
68-
width: calc(100% - calc(var(--local-scope-rem, 1rem) * 2));
69-
}
70-
```
71-
72-
#### Options
73-
74-
| Parameter | Type | Default | Description |
75-
|-----------|------|---------|-------------|
76-
| `varName` | `string` | `'--local-scope-rem'` | CSS variable name for the base rem value |
77-
78-
## License
79-
80-
MIT
26+
px to scope unit.

0 commit comments

Comments
 (0)