🚀 DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more →
Socket
Book a DemoInstallSign in
Socket

svelte-windicss-preprocess

Package Overview
Dependencies
Maintainers
2
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-windicss-preprocess

A Svelte Preprocessor to compile tailwindcss at build time based on windicss compiler.

Source
npmnpm
Version
3.0.1
Version published
Maintainers
2
Created
Source

svelte-windicss-preprocess

A svelte preprocessor for windicss. Windi CSS is a next generation utility-first CSS framework.

If you are already familiar with Tailwind CSS, think about Windi CSS as an on-demanded alternative to Tailwind, which provides faster load times, fully compatible with Tailwind v2.0 and with a bunch of additional cool features.

Installation

Now we have a great playground, you can try it online before installing it.

npm i -D svelte-windicss-preprocess

Configuration

// svelte.config.js
module.exports = {
  preprocess: require("svelte-windicss-preprocess").preprocess({
    compile: false,
    prefix: 'windi-',
  }),
};
optiondescription
configstring that represent the location of windicss configuration
safeListarray of classes windicss should include even if not used in markup
compileboolean wether windicss runs in compilation or interpretion mode
prefixclass prefix if preprocessor is running in compilation mode
silentboolean of logging

Integrations

Vanilla Svelte

// rollup.config.js
export default {
  // ...
  plugins: [
    svelte({
      // ...
      preprocess: [
        require('svelte-windicss-preprocess').preprocess({
          config: 'windi.config.js', // windi config file path (optional)
          compile: true, // false: interpretation mode; true: compilation mode (optional)
          prefix: 'windi-', // set compilation mode style prefix
          safeList: ["bg-gray-600", "text-white"] // (optional)
        })
      ],
    }),
  ],
  // ...
};

Snowpack Svelte

// svelte.config.js
module.exports = {
  preprocess: [
    require('svelte-windicss-preprocess').preprocess({
      config: 'windi.config.js', // windi config file path (optional)
      compile: true, // false: interpretation mode; true: compilation mode (optional)
      prefix: 'windi-', // set compilation mode style prefix
      safeList: ["bg-gray-600", "text-white"] // (optional)
    })
  ],
};

Rollup Sapper

// rollup.config.js
export default {
  client: {
    // ...
    plugins: [
      // ...
      svelte({
        // ...
        preprocess: [
          require('svelte-windicss-preprocess').preprocess({
            config: 'windi.config.js', // windi config file path (optional)
            compile: true, // false: interpretation mode; true: compilation mode (optional)
            prefix: 'windi-', // set compilation mode style prefix
            safeList: ["bg-gray-600", "text-white"] // (optional)
          })
        ],
      }),
      // ...
    ],
  },

  server: {
    // ...
    plugins: [
      // ...
      svelte({
        // ...
        preprocess: [
          require('svelte-windicss-preprocess').preprocess({
            config: 'windi.config.js', // windi config file path (optional)
            compile: true, // false: interpretation mode; true: compilation mode (optional)
            prefix: 'windi-', // set compilation mode style prefix
            safeList: ["bg-gray-600", "text-white"] // (optional)
          })
        ],
      }),
      // ...
    ],
  },
};

Resources

Keywords

svelte

FAQs

Package last updated on 18 Mar 2021

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