Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
tw-variables
Advanced tools
400 useful, ready-to-import CSS variables generated straight from Tailwind source files.
~400 useful, ready-to-import CSS variables generated straight from Tailwind source files.
Source | Type |
---|---|
jsDelivr | Minified |
GitHub | Unminified |
All variables including colors:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tw-variables/dist/variables.css" />
One or more subsets:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tw-variables/dist/colors.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tw-variables/dist/size.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tw-variables/dist/sky.css" />
Preflight:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tw-variables/dist/preflight.css" />
pnpm add -D tw-variables
All variables (including colors):
import 'tw-variables/variables.css'
One or more subsets:
import 'tw-variables/colors.css'
import 'tw-variables/size.css'
import 'tw-variables/green.css'
Preflight:
import 'tw-variables/preflight.css'
If using PostCSS, you can use this package in conjunction with postcss-jit-props to strip any unused variable from the final CSS:
pnpm add -D postcss postcss-jit-props
const postcssJitProps = require('postcss-jit-props')
const twVariables = require('tw-variables')
module.exports = {
plugins: [postcssJitProps(twVariables)],
}
.my-container {
width: var(--width-full);
max-width: var(--width-xl);
z-index: var(--z-10);
padding: var(--size-4);
margin: var(--size-6);
font-family: 'Basier Circle', var(--family-sans);
font-size: var(--text-base);
font-weight: var(--font-medium);
line-height: var(--leading-normal);
letter-spacing: var(--tracking-tight);
color: var(--blue-500);
background-color: var(--slate-500);
border: var(--border-2) solid var(--blue-500);
border-radius: var(--radius-2xl);
box-shadow: var(--shadow-lg);
}
Name | Prefix | Import | Reference |
---|---|---|---|
blur | --blur- | tw-variables/blur.css | Link |
borderRadius | --radius- | tw-variables/border-radius.css | Link |
borderWidth | --border- | tw-variables/border-width.css | Link |
boxShadow | --shadow- | tw-variables/box-shadow.css | Link |
colors | --blue- , --slate- ... | tw-variables/colors.css | Link |
dropShadow | --drop- | tw-variables/drop-shadow.css | Link |
fontWeight | --font- | tw-variables/font-weight.css | Link |
fontFamily | --family- | tw-variables/font-family.css | Link |
fontSize | --text- | tw-variables/font-size.css | Link |
letterSpacing | --tracking- | tw-variables/letter-spacing.css | Link |
lineHeight | --leading- | tw-variables/line-height.css | Link |
opacity | --opacity- | tw-variables/opacity.css | Link |
maxWidth | --width- | tw-variables/width.css | Link |
screens | --screen- | tw-variables/screen.css | Link |
spacing | --size- | tw-variables/size.css | Link |
transitionTimingFunction | --easing- | tw-variables/easing.css | Link |
zIndex | --z- | tw-variables/z-index.css | Link |
Colors reference: Link
Name | Prefix | Import |
---|---|---|
amber | --amber- | tw-variables/amber.css |
blue | --blue- | tw-variables/blue.css |
cyan | --cyan- | tw-variables/cyan.css |
emerald | --emerald- | tw-variables/emerald.css |
fuchsia | --fuchsia- | tw-variables/fuchsia.css |
gray | --gray- | tw-variables/gray.css |
green | --green- | tw-variables/green.css |
indigo | --indigo- | tw-variables/indigo.css |
lime | --lime- | tw-variables/lime.css |
neutral | --neutral- | tw-variables/neutral.css |
orange | --orange- | tw-variables/orange.css |
pink | --pink- | tw-variables/pink.css |
purple | --purple- | tw-variables/purple.css |
red | --red- | tw-variables/red.css |
rose | --rose- | tw-variables/rose.css |
slate | --slate- | tw-variables/slate.css |
sky | --sky- | tw-variables/sky.css |
teal | --teal- | tw-variables/teal.css |
violet | --violet- | tw-variables/violet.css |
yellow | --yellow- | tw-variables/yellow.css |
zinc | --zinc- | tw-variables/zinc.css |
Since the output is generated as expected, for now, I consider this package "complete". I also see no point in updating it everytime Tailwind releases a new version.
Once Tailwind will drop some new tokens that are worth to be added, I'll make sure to include them in a new version of this package.
Open Props by Adam Argyle
0BSD
FAQs
400 useful, ready-to-import CSS variables generated straight from Tailwind source files.
The npm package tw-variables receives a total of 0 weekly downloads. As such, tw-variables popularity was classified as not popular.
We found that tw-variables 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.