Vicinage ·
Type-safe and zero-runtime UI styling, right in the markup.
Vicinage lets you write strongly-typed CSS objects directly on your markup. At build time, it preprocesses them into StyleX API calls, which StyleX then extracts into zero-runtime atomic CSS, with no style block naming required.
Table of Contents
Quick Start
Setup
Vicinage is implemented as a preprocessor for StyleX.
Install the packages:
npm install vicinage @stylexjs/stylex
npm install --save-dev @vicinage/unplugin @stylexjs/unplugin
Add the plugin to your bundler configuration right before the StyleX plugin.
import { defineConfig } from 'vite'
import vicinage from '@vicinage/unplugin'
import stylex from '@stylexjs/unplugin'
export default defineConfig({
plugins: [
vicinage.vite(),
stylex.vite(),
// ...other plugins
],
})
…