
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
vite-plugin-vue-autoclass
Advanced tools
This is a vite pluging for vue project.
With it you can add some post-css style class in template tag. like follow code:
<div class="w88"></div>
Then the plugin will generate the css class '.w88 { width: 88px }' in '/src/auto.css' automaticly. it will be loaded also automaticly.
...
import {autoClassPlugin} from 'vite-plugin-vue-autoclass'
export default defineConfig({
plugins: [vue(), autoClassPlugin({
mainjsFile: 'main.ts'
})],
...
)}
You can use options param. the default options as bellow:
const defaultOptions = {
cssFile : 'auto.css',
mainUnit: 'px',
mainjsFile: 'main.js',
refreshInit: true, // 当设为 true, dev启动时会手动刷新页面一次,以响应项目未启动时vue页面代码新增的css类
classTypes: {
w: {key: 'width', unit}, //unit 取值为传入的mainUnit
h: {key: 'height', unit},
lh: {key: 'line-height', unit},
minh: {key: 'min-height', unit},
minw: {key: 'min-width', unit},
maxh: {key: 'max-height', unit},
maxw: {key: 'max-width', unit},
vw: {key: 'width', unit:'vw'},
vh: {key: 'height', unit: 'vh'},
pw: {key: 'width', unit: '%'},
ph: {key: 'height', unit: '%'},
p: {key: 'padding', unit},
pl: {key: 'padding-left', unit},
pr: {key: 'padding-right', unit},
pt: {key: 'padding-top', unit},
pb: {key: 'padding-bottom', unit},
m: {key: 'margin', unit},
ml: {key: 'margin-left', unit},
mr: {key: 'margin-right', unit},
mt: {key: 'margin-top', unit},
mb: {key: 'margin-bottom', unit},
fs: {key: 'font-size', unit},
bdr:{key: 'border-radius', unit},
bdrtl:{key: 'border-top-left-radius', unit},
bdrtr:{key: 'border-top-right-radius', unit},
bdrbl:{key: 'border-bottom-left-radius', unit},
bdrbr:{key: 'border-bottom-right-radius', unit},
op: {key: 'opacity', unit:'%'},
z: {key: 'z-index', unit:''},
fl: {key: 'flex', unit: ''}
}
}
For example: class="mb20" => .mb20 { margin-bottom: 20px }
FAQs
Auto generate tail-wind style class for vue
The npm package vite-plugin-vue-autoclass receives a total of 0 weekly downloads. As such, vite-plugin-vue-autoclass popularity was classified as not popular.
We found that vite-plugin-vue-autoclass demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.