diff --git a/README.md b/README.md index ecbc9c44..06bc398a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ <p align="center"> <a href="https://github.com/gohugoio/hugo" target="_blank"><img src="https://img.shields.io/badge/Hugo-≥0.97-green?style=for-the-badge&logo=hugo&logoColor=white" /></a> - <!-- <a href="https://github.com/Ice-Hazymoon/hugo-theme-luna/actions/workflows/main.yml" target="_blank"><img src="https://img.shields.io/github/workflow/status/Ice-Hazymoon/hugo-theme-luna/CI?style=for-the-badge&logo=github&logoColor=white" /></a> --> + <a href="https://github.com/Ice-Hazymoon/hugo-theme-luna/actions/workflows/main.yml" target="_blank"><img src="https://img.shields.io/github/actions/workflow/status/Ice-Hazymoon/hugo-theme-luna/main.yml?style=for-the-badge&branch=master&logo=github&logoColor=white" /></a> <a href="https://github.com/Ice-Hazymoon/hugo-theme-luna/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/github/license/Ice-Hazymoon/hugo-theme-luna?style=for-the-badge" /></a> </p> 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