From 3c45fee038486513121b2b72de038c9051e305ff Mon Sep 17 00:00:00 2001 From: Ilia Mikhailov Date: Sat, 3 Oct 2020 10:02:49 +0200 Subject: [PATCH] Update deps and simplify setup --- package.json | 18 +++++++++--------- postcss.config.js | 17 ++++++++++++----- purgecss.config.js | 9 --------- tailwind.config.js | 38 +++++++++++++++++--------------------- 4 files changed, 38 insertions(+), 44 deletions(-) delete mode 100644 purgecss.config.js diff --git a/package.json b/package.json index 3025974..4eac3f3 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Svelte with Tailwind and Parcel", "main": "./src/main.js", - "author": "iljoo", + "author": "codechips", "license": "MIT", "private": false, "scripts": { @@ -14,15 +14,15 @@ "last 1 chrome versions" ], "devDependencies": { - "@fullhuman/postcss-purgecss": "^2.1.0", - "autoprefixer": "^9.7.3", "eslint-plugin-svelte3": "^2.7.3", "parcel-bundler": "^1.12.4", - "parcel-plugin-svelte": "^4.0.5", - "prettier": "^2.0.2", - "prettier-plugin-svelte": "^0.7.0", - "svelte": "^3.16.7", - "tailwindcss": "^1.1.4", - "tailwindcss-font-inter": "^1.0.7" + "parcel-plugin-svelte": "^4.0.6", + "postcss-load-config": "^3.0.0", + "postcss-preset-env": "^6.7.0", + "prettier": "^2.1.2", + "prettier-plugin-svelte": "^1.4.0", + "svelte": "^3.29.0", + "tailwindcss": "^1.8.10", + "tailwindcss-font-inter": "^1.0.8" } } diff --git a/postcss.config.js b/postcss.config.js index 9fc81cf..b3f969d 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,13 @@ -const plugins = - process.env.NODE_ENV === 'production' - ? ['tailwindcss', 'autoprefixer', '@fullhuman/postcss-purgecss'] - : ['tailwindcss']; +const postcssPresetEnv = require('postcss-preset-env'); -module.exports = {plugins}; +const presetEnv = postcssPresetEnv({ + /* use stage 3 features + css nesting rules */ + stage: 3, + features: { + 'nesting-rules': true, + }, +}); + +module.exports = { + plugins: [require('tailwindcss'), presetEnv], +}; diff --git a/purgecss.config.js b/purgecss.config.js deleted file mode 100644 index e3a5eaf..0000000 --- a/purgecss.config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - content: [ - './src/index.html', - './src/**/*.svelte' - ], - whitelistPatterns: [/svelte-/], - defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || [] -}; - diff --git a/tailwind.config.js b/tailwind.config.js index 74cbd52..b97747b 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,32 +1,28 @@ module.exports = { + future: { + removeDeprecatedGapUtilities: true, + }, + experimental: { + uniformColorPalette: true, + extendedFontSizeScale: true, + applyComplexClasses: true, + }, + purge: { + content: ['./src/index.html', './src/**/*.svelte'], + whitelistPatterns: [/svelte-/], + }, theme: { interFontFeatures: { default: ['calt', 'liga', 'kern'], - numeric: ['tnum', 'salt', 'ss02'] - }, - fontSize: { - xs: '0.75rem', - sm: '0.875rem', - base: '1rem', - lg: '1.125rem', - xl: '1.25rem', - '2xl': '1.5rem', - '3xl': '1.875rem', - '4xl': '2.25rem', - '5xl': '3rem', - '6xl': '4rem', - '7xl': '6rem', - '8xl': '8rem', - '9xl': '9rem', - '10xl': '10rem' + numeric: ['tnum', 'salt', 'ss02'], }, - extend: {} + extend: {}, }, variants: {}, plugins: [ require('tailwindcss-font-inter')({ importFontFace: true, - disableUnusedFeatures: true - }) - ] + disableUnusedFeatures: true, + }), + ], };