@import all styles to style.css

Let's modularise our CSS and @import it all to one place!
This commit is contained in:
Badri Sunderarajan 2020-04-10 15:41:24 +05:30
parent e2597c9210
commit 4194231444
6 changed files with 19 additions and 7 deletions

View file

@ -4,12 +4,13 @@
"autoprefixer": "^9.7.5", "autoprefixer": "^9.7.5",
"cssnano": "^4.1.10", "cssnano": "^4.1.10",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"postcss-import": "^12.0.1",
"tailwindcss": "^1.2.0", "tailwindcss": "^1.2.0",
"watch": "^1.0.2" "watch": "^1.0.2"
}, },
"scripts": { "scripts": {
"build": "npm-run-all build:css build:html", "build": "npm-run-all build:css build:html",
"build:css": "postcss src/tailwind.css -o dist/tailwind.css", "build:css": "postcss src/style.css -o dist/style.css",
"build:html": "eleventy", "build:html": "eleventy",
"watch": "watch 'npm run build' ./src" "watch": "watch 'npm run build' ./src"
}, },

View file

@ -3,6 +3,7 @@ const cssnano = require('cssnano')
module.exports = { module.exports = {
plugins: [ plugins: [
require('postcss-import'),
require('tailwindcss'), require('tailwindcss'),
process.env.NODE_ENV === 'production' ? require('autoprefixer') : null, process.env.NODE_ENV === 'production' ? require('autoprefixer') : null,
process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'production'

View file

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Snipette Writers' Programme</title> <title>Snipette Writers' Programme</title>
<link rel="stylesheet" href="tailwind.css" /> <link rel="stylesheet" href="style.css" />
</head> </head>
<body class="bg-orange-100"> <body class="bg-orange-100">
<div class="bg-orange-800 p-10 text-center"> <div class="bg-orange-800 p-10 text-center">

3
src/style.css Normal file
View file

@ -0,0 +1,3 @@
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

View file

@ -1,3 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View file

@ -3235,6 +3235,16 @@ postcss-functions@^3.0.0:
postcss "^6.0.9" postcss "^6.0.9"
postcss-value-parser "^3.3.0" postcss-value-parser "^3.3.0"
postcss-import@^12.0.1:
version "12.0.1"
resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-12.0.1.tgz#cf8c7ab0b5ccab5649024536e565f841928b7153"
integrity sha512-3Gti33dmCjyKBgimqGxL3vcV8w9+bsHwO5UrBawp796+jdardbcFl4RP5w/76BwNL7aGzpKstIfF9I+kdE8pTw==
dependencies:
postcss "^7.0.1"
postcss-value-parser "^3.2.3"
read-cache "^1.0.0"
resolve "^1.1.7"
postcss-js@^2.0.0: postcss-js@^2.0.0:
version "2.0.3" version "2.0.3"
resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-2.0.3.tgz#a96f0f23ff3d08cec7dc5b11bf11c5f8077cdab9" resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-2.0.3.tgz#a96f0f23ff3d08cec7dc5b11bf11c5f8077cdab9"
@ -3478,7 +3488,7 @@ postcss-unique-selectors@^4.0.1:
postcss "^7.0.0" postcss "^7.0.0"
uniqs "^2.0.0" uniqs "^2.0.0"
postcss-value-parser@^3.0.0, postcss-value-parser@^3.3.0: postcss-value-parser@^3.0.0, postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0:
version "3.3.1" version "3.3.1"
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281"
integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==
@ -3838,7 +3848,7 @@ resolve-url@^0.2.1:
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2: resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2:
version "1.15.1" version "1.15.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8"
integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==