zoukankan      html  css  js  c++  java
  • [Poi] Setup PostCSS and Tailwind with Poi

    This lesson walks through setting up a Poi project using PostCSS and the popular Tailwind library for building out your styles. Poi supports PostCSS out of the box, but to show the true power of PostCSS, you need leverage PostCSS plugins which requires its own bit of setup.

    Install:

    npm i -D tailwindcss

    Init tailwind:

    npx tailwind init    

    It will generate a tailwind.js file.

    Create a postcss.config.js:

    const tailwindcss = require('tailwindcss');
    
    module.exports = {
        plugins: [
            tailwindcss("./tailwind.js")
        ]
    };

    index.js:

    import "./style.css";
    
    document.querySelector("#app")
        .innerHTML = `
        <div class="hello">Hello Tailwind</div> 
        `;

    style.css:

    @tailwind preflight;
    .hello {
        @apply .text-white .bg-grey
    }
    @tailwind utilities;
  • 相关阅读:
    代码希望HTML5初探CSS3新特性小示例
    myeclipse及eclipse的优化
    window7如何提高到最高权限
    大麦茶
    poj3292
    poj3278
    poj3100
    poj3117
    poj3299
    Presto性能调优的五大技巧
  • 原文地址:https://www.cnblogs.com/Answer1215/p/8198231.html
Copyright © 2011-2022 走看看