https://github.com/sonofmagic/tailwindcss-rem2px-preset
tailwindcss-rem2px-preset
https://github.com/sonofmagic/tailwindcss-rem2px-preset
Last synced: over 1 year ago
JSON representation
tailwindcss-rem2px-preset
- Host: GitHub
- URL: https://github.com/sonofmagic/tailwindcss-rem2px-preset
- Owner: sonofmagic
- License: mit
- Created: 2022-06-16T02:16:11.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T09:58:43.000Z (almost 2 years ago)
- Last Synced: 2024-10-22T18:03:53.235Z (over 1 year ago)
- Language: TypeScript
- Size: 245 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tailwindcss-rem2px-preset
Allow configuration for using px instead of rem.
Default: `1rem` -> `16px`, Of course you can custom this
## Usage
### Default
`1rem` -> `16px`
```js
// tailwind.config.js
module.exports = {
presets: [
require('tailwindcss-rem2px-preset')
],
// ...
}
```
### Custom
For weapp developers, we need to use `rpx` instead of `rem`
e.g: `1rem` -> `32rpx`
```js
// tailwind.config.js
module.exports = {
presets: [
require('tailwindcss-rem2px-preset').createPreset({
fontSize: 32,
unit: 'rpx'
})
],
// ...
}
```