GithubHelp home page GithubHelp logo

multics / svelte-windicss-preprocess Goto Github PK

View Code? Open in Web Editor NEW

This project forked from windicss/svelte-windicss-preprocess

0.0 0.0 0.0 4.21 MB

A Svelte Preprocessor to compile tailwindcss at build time.

Home Page: https://windicss.github.io/svelte-windicss-preprocess

License: MIT License

TypeScript 90.71% JavaScript 9.29%

svelte-windicss-preprocess's Introduction

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.

⚠️⚠️⚠️ SVELTE KIT ⚠️⚠️⚠️

For svelte-kit with vite please try to use our vite-plugin first. This repo is meant for special use cases or bundler solution without SSR.

we do have an experimental option flag kit: true on svelte-windicss-preprocess


Installation

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

npm i -D svelte-windicss-preprocess

Configuration

Default Options shown below

// svelte.config.js
module.exports = {
  preprocess: require('svelte-windicss-preprocess').preprocess({
    compile: false,
    prefix: 'windi-',
    verbosity: 1,
    debug: false,
    devTools: {
      completions: false,
    },
  }),
};
option description
config string that represent the location of windicss configuration
safeList array of classes windicss should include even if not used in markup
compile boolean wether windicss runs in compilation or interpretion mode
prefix class prefix if preprocessor is running in compilation mode
silent boolean of logging
devTools object to configure optional windicss devTools
devTools.enabled boolean to activate windi devtools in runtime
devTools.completions boolean to activate css class auto-completion in devtools

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

svelte-windicss-preprocess's People

Contributors

alexanderniebuhr avatar dependabot[bot] avatar multics avatar munxar avatar noahsalvi avatar oysterd3 avatar rehhouari avatar tmaxmax avatar voorjaar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.