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;
  • 相关阅读:
    from import 的认识
    模块初识
    eq方法
    hash介绍
    item系列
    析构函数
    serializers进阶
    APIView源码解析
    RPC协议
    面试题补充
  • 原文地址:https://www.cnblogs.com/Answer1215/p/8198231.html
Copyright © 2011-2022 走看看