Socket
Socket
Sign inDemoInstall

unocss

Package Overview
Dependencies
Maintainers
1
Versions
366
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unocss - npm Package Compare versions

Comparing version 0.4.16 to 0.5.0

4

dist/vite.js

@@ -8,3 +8,5 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, get: () => obj[key]}); }); }// src/vite.ts

presets: [
_presetuno2.default.call(void 0, )
_presetuno2.default.call(void 0, {
dev: process.env.NODE_ENV === "development"
})
]

@@ -11,0 +13,0 @@ });

{
"name": "unocss",
"version": "0.4.16",
"version": "0.5.0",
"description": "The instant on-demand Atomic CSS engine.",

@@ -43,8 +43,8 @@ "keywords": [

"dependencies": {
"@unocss/core": "0.4.16",
"@unocss/reset": "0.4.16",
"@unocss/preset-icons": "0.4.16",
"@unocss/preset-attributify": "0.4.16",
"@unocss/preset-uno": "0.4.16",
"@unocss/vite": "0.4.16"
"@unocss/core": "0.5.0",
"@unocss/reset": "0.5.0",
"@unocss/preset-icons": "0.5.0",
"@unocss/preset-attributify": "0.5.0",
"@unocss/preset-uno": "0.5.0",
"@unocss/vite": "0.5.0"
},

@@ -51,0 +51,0 @@ "engines": {

@@ -30,9 +30,9 @@ # UnoCSS

```
10/21/2021, 2:17:45 PM
11/5/2021, 4:26:57 AM
1656 utilities | x50 runs (min build time)
none 8.75 ms / delta. 0.00 ms
unocss v0.0.0 13.72 ms / delta. 4.97 ms (x1.00)
windicss v3.1.9 980.41 ms / delta. 971.66 ms (x195.36)
tailwindcss v3.0.0-alpha.1 1258.54 ms / delta. 1249.79 ms (x251.28)
none 8.30 ms / delta. 0.00 ms
unocss v0.4.15 13.58 ms / delta. 5.28 ms (x1.00)
windicss v3.2.1 989.57 ms / delta. 981.27 ms (x185.94)
tailwindcss v3.0.0-alpha.1 1290.96 ms / delta. 1282.66 ms (x243.05)
```

@@ -346,2 +346,4 @@

Learn more at [@unocss/reset](https://github.com/antfu/unocss/tree/main/packages/reset).
### Custom Variants

@@ -392,2 +394,51 @@

### Layers
The orders of CSS will affect their priorities. While we will [retain the order of rules](#ordering), sometimes you may want to group some utilities to have more explicit control of their orders.
Unlike Tailwind, which offers fixed 3 layers (`base`, `components`, `utilities`), UnoCSS allows you to define your own layers as you want. To set the layer, you can pass the metadata as the third item of your rules:
```ts
rules: [
[/^m-(\d)$/, ([, d]) => ({ margin: `${d / 4}rem` }), { layer: 'utilities' }],
// when you omit the layer, it will be `default`
['btn', { padding: '4px' }]
]
```
This will make it generates:
```css
/* layer: default */
.btn { padding: 4px; }
/* layer: utilities */
.m-2 { margin: 0.5rem; }
```
You can control the order of layers by:
```ts
layers: {
components: -1,
default: 1,
utilities: 2,
'my-layer': 3,
}
```
Layers without specified order will be sorted alphabetically.
When you want to have your custom CSS between layers, you can update your entry module:
```ts
// 'uno:[layer-name].css'
import 'uno:components.css'
// layers that are not 'components' and 'utilities' will fallback to here
import 'uno.css'
// your own CSS
import './my-custom.css'
// "utilities" layer will have the highest priority
import 'uno:utilities.css'
```
### CSS Scoping

@@ -394,0 +445,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc