Skip to content

Instantly share code, notes, and snippets.

@florianjs
Last active February 23, 2020 15:18
Show Gist options
  • Select an option

  • Save florianjs/cb81c38bc446d5fcec2a45df362f94d7 to your computer and use it in GitHub Desktop.

Select an option

Save florianjs/cb81c38bc446d5fcec2a45df362f94d7 to your computer and use it in GitHub Desktop.

Revisions

  1. florianjs revised this gist Feb 23, 2020. 2 changed files with 3 additions and 3 deletions.
    4 changes: 2 additions & 2 deletions README.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    Install all packages:
    npm init -y
    npm i postcss-cli postcss cssnano @fullhuman/postcss-purgecss --save-dev
    npm i postcss-cli postcss cssnano @fullhuman/postcss-purgecss tailwindcss --save-dev
    npm i watch --save-dev // ( optionnal )

    package.json :
    @@ -9,7 +9,7 @@ Change the path to your styles.css and main.css ( "build:css": "postcss YOUR_
    postcss.config.js :
    Change the path to your *.html files and *.js files (if needed) in line 13

    Follow the Steps 1 - 2 - 3 & 4 : https://tailwindcss.com/docs/installation/
    Follow the Steps 2 - 3 & 4 : https://tailwindcss.com/docs/installation/

    When you are ready, build it :
    npm run build:css
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    {
    "name": "Delightful",
    "name": "YOUR_OWN_NAME",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
  2. florianjs revised this gist Feb 23, 2020. 1 changed file with 6 additions and 7 deletions.
    13 changes: 6 additions & 7 deletions README.txt
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,14 @@
    package.json :
    Change the path to your styles.css and main.css ( generated CSS) on the line 7

    postcss.config.js :
    Change the path to your *.html files and *.js files (if needed) in line 13


    Install all packages:
    npm init -y
    npm i postcss-cli postcss cssnano @fullhuman/postcss-purgecss --save-dev
    npm i watch --save-dev // ( optionnal )

    package.json :
    Change the path to your styles.css and main.css ( "build:css": "postcss YOUR_PATH/styles.css -o YOUR_PATH/main.css", )

    postcss.config.js :
    Change the path to your *.html files and *.js files (if needed) in line 13

    Follow the Steps 1 - 2 - 3 & 4 : https://tailwindcss.com/docs/installation/

    When you are ready, build it :
  3. florianjs revised this gist Feb 16, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.txt
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,7 @@ Change the path to your *.html files and *.js files (if needed) in line 13


    Install all packages:
    npm init -y
    npm i postcss-cli postcss cssnano @fullhuman/postcss-purgecss --save-dev
    npm i watch --save-dev // ( optionnal )

  4. florianjs revised this gist Feb 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.txt
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Change the path to your *.html files and *.js files (if needed) in line 13

    Install all packages:
    npm i postcss-cli postcss cssnano @fullhuman/postcss-purgecss --save-dev
    npm i watch --save // ( optionnal )
    npm i watch --save-dev // ( optionnal )

    Follow the Steps 1 - 2 - 3 & 4 : https://tailwindcss.com/docs/installation/

  5. florianjs revised this gist Feb 16, 2020. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion README.txt
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,14 @@ package.json :
    Change the path to your styles.css and main.css ( generated CSS) on the line 7

    postcss.config.js :
    Change the path to your *.html files and *.js files (if needed) in line 13
    Change the path to your *.html files and *.js files (if needed) in line 13


    Install all packages:
    npm i postcss-cli postcss cssnano @fullhuman/postcss-purgecss --save-dev
    npm i watch --save // ( optionnal )

    Follow the Steps 1 - 2 - 3 & 4 : https://tailwindcss.com/docs/installation/

    When you are ready, build it :
    npm run build:css
  6. florianjs created this gist Feb 16, 2020.
    5 changes: 5 additions & 0 deletions README.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    package.json :
    Change the path to your styles.css and main.css ( generated CSS) on the line 7

    postcss.config.js :
    Change the path to your *.html files and *.js files (if needed) in line 13
    23 changes: 23 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    {
    "name": "Delightful",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
    "build:css": "postcss styles.css -o main.css",
    "watch": "watch \"npm run build:css\" ./"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "devDependencies": {
    "@fullhuman/postcss-purgecss": "^2.0.6",
    "cssnano": "^4.1.10",
    "postcss": "^7.0.26",
    "postcss-cli": "^7.1.0",
    "tailwindcss": "^1.2.0"
    },
    "dependencies": {
    "watch": "^1.0.2"
    }
    }
    18 changes: 18 additions & 0 deletions postcss.config.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    const tailwindcss = require('tailwindcss');
    const purgecss = require('@fullhuman/postcss-purgecss');
    const cssnano = require('cssnano');
    const autoprefixer = require('autoprefixer');

    module.exports = {
    plugins: [
    tailwindcss('./tailwind.config.js'),
    cssnano({
    preset: 'default'
    }),
    purgecss({
    content: ['./*.html', './assets/js/*.js'],
    defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || []
    }),
    autoprefixer
    ]
    };
    6 changes: 6 additions & 0 deletions styles.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    /* purgecss start ignore */
    @tailwind base;
    @tailwind components;
    /* purgecss end ignore */

    @tailwind utilities;