Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bun-lightningcss

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-lightningcss

[Lightning CSS](https://lightningcss.dev/) plugin for Bun with full support for [class composition](https://lightningcss.dev/css-modules.html#class-composition).

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
263
decreased by-33.08%
Maintainers
1
Weekly downloads
 
Created
Source

bun-lightningcss

Lightning CSS plugin for Bun with full support for class composition.

Install

bun install -d bun-lightningcss

Usage

import lightningcss from 'bun-lightningcss'

await Bun.build({
  entrypoints: ['./index.tsx'],
  outdir: './dist',
  plugins: [lightningcss()],
})

Say you have a app.module.css file...

.bg-indigo {
  background: indigo;
}

.container {
  /* https://lightningcss.dev/css-modules.html#class-composition */
  composes: bg-indigo;
  color: white;
}

Import and use it like so

import styles from './app.module.css'

export default function App() {
  return (
    <div className={styles.container}>
      Hello, Bun!
    </div>
  )
}

TypeScript Shim

Add the following to your .d.ts file:

declare module '*.module.css' {
  const styles: {
    readonly [key: string]: string
  }
  export default styles
}

License

MIT

Keywords

FAQs

Package last updated on 09 Sep 2023

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