From 0d72b1dd4779b8855de6878a01bf415e611baba2 Mon Sep 17 00:00:00 2001 From: Ice-Hazymoon Date: Mon, 20 Feb 2023 18:08:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- assets/sass/theme.scss | 9 +++------ package.json | 4 ++-- postcss.config.js | 42 ++++++++++++++++++++---------------------- 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index ecbc9c44..06bc398a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

- +

diff --git a/assets/sass/theme.scss b/assets/sass/theme.scss index 32f63618..8262c472 100644 --- a/assets/sass/theme.scss +++ b/assets/sass/theme.scss @@ -19,20 +19,17 @@ $opacities: 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90; @each $opacity in $opacities { + $alpha: $opacity / 100; .bg-theme\/#{$opacity} { background-color: rgba( $color: $theme, - $alpha: ( - $opacity / 100, - ) + $alpha: $alpha ); } .hover\:bg-theme\/#{$opacity}:hover { background-color: rgba( $color: $theme, - $alpha: ( - $opacity / 100, - ) + $alpha: $alpha ); } } diff --git a/package.json b/package.json index 50e930d6..8fcebabb 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "author": "Ice-Hazymoon", "scripts": { "updateModules": "node ./updateModules.js", - "generateCss": "postcss ./assets/sass/main.scss -o ./assets/main.scss", + "generateCss": "postcss ./assets/sass/main.scss -o ./assets/sass/main-without-postcss.scss", "prettier": "npx prettier --write ./layouts/**/*.html ./assets/sass/**/*.scss" }, "homepage": "https://github.com/Ice-Hazymoon/hugo-theme-luna", @@ -55,4 +55,4 @@ "browserslist": [ "last 1 Chrome versions" ] -} \ No newline at end of file +} diff --git a/postcss.config.js b/postcss.config.js index b43c8027..ec4f1663 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,25 +1,23 @@ const path = require('path'); - const isDev = process.env.HUGO_ENVIRONMENT !== 'production'; - module.exports = { modules: true, - plugins: !isDev ? { - tailwindcss: { - config: path.join(__dirname, '/tailwind.config.js'), - }, - 'postcss-pxtorem': { + plugins: !isDev ? [ + require('tailwindcss')({ + config: path.join(__dirname, '/tailwind.config.js') + }), + require('postcss-pxtorem')({ rootValue: 16, propList: ['*'], selectorBlackList: ['html'] - }, - autoprefixer: {}, - 'postcss-easing-gradients': {}, - 'postcss-font-display': { + }), + require('autoprefixer')({}), + require('postcss-easing-gradients')({}), + require('postcss-font-display')({ display: 'swap', replace: false - }, - '@fullhuman/postcss-purgecss': { + }), + require('@fullhuman/postcss-purgecss')({ content: [ path.join(__dirname, '/data/luna/icon.yaml').split(path.sep).join(path.posix.sep), path.join(__dirname, '/layouts/**/*.html').split(path.sep).join(path.posix.sep), @@ -38,18 +36,18 @@ module.exports = { fontFace: false, variables: false, rejected: true, - }, - cssnano: { + }), + require('cssnano')({ preset: ['cssnano-preset-advanced', { discardComments: { removeAll: true, } }] - }, - }: { - tailwindcss: { - config: path.join(__dirname, '/tailwind.config.js'), - }, - 'postcss-easing-gradients': {}, - } + }), + ] : [ + require('tailwindcss')({ + config: path.join(__dirname, '/tailwind.config.js') + }), + require('postcss-easing-gradients')({}), + ] } \ No newline at end of file