New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vanilla-extract/vite-plugin

Package Overview
Dependencies
Maintainers
4
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vanilla-extract/vite-plugin

Zero-runtime Stylesheets-in-TypeScript

  • 4.0.20-externalize-cssesc-20250128034856
  • externalize-cssesc
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
108K
increased by3.31%
Maintainers
4
Weekly downloads
 
Created

What is @vanilla-extract/vite-plugin?

@vanilla-extract/vite-plugin is a Vite plugin that integrates with the vanilla-extract CSS-in-JS library. It allows developers to use vanilla-extract's zero-runtime CSS framework within Vite projects, enabling the creation of type-safe, themeable, and performant styles.

What are @vanilla-extract/vite-plugin's main functionalities?

Integration with Vite

This feature allows you to integrate vanilla-extract with a Vite project. By adding the plugin to the Vite configuration, you can use vanilla-extract's CSS-in-JS capabilities seamlessly within your Vite application.

import { defineConfig } from 'vite';
import vanillaExtractPlugin from '@vanilla-extract/vite-plugin';

export default defineConfig({
  plugins: [vanillaExtractPlugin()]
});

Type-safe CSS

This feature allows you to define styles using TypeScript, ensuring type safety and autocompletion. The styles are compiled to static CSS at build time, providing a zero-runtime solution.

import { style } from '@vanilla-extract/css';

export const button = style({
  backgroundColor: 'blue',
  color: 'white',
  padding: '10px 20px',
  borderRadius: '5px'
});

Theming support

This feature allows you to create themes and use them in your styles. The createTheme function generates CSS variables that can be used throughout your styles, making it easy to switch themes dynamically.

import { createTheme, style } from '@vanilla-extract/css';

export const [themeClass, vars] = createTheme({
  color: {
    primary: 'blue',
    secondary: 'green'
  }
});

export const button = style({
  backgroundColor: vars.color.primary,
  color: 'white'
});

Other packages similar to @vanilla-extract/vite-plugin

FAQs

Package last updated on 28 Jan 2025

Did you know?

Socket

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.

Install

Related posts

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