-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: create another postcss.config.js for RTL
- Loading branch information
Showing
6 changed files
with
59 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const purgecss = require('../../../../purgecss.config.js').default; | ||
|
||
const autoprefixer = require('autoprefixer'); | ||
const rtlcss = require('rtlcss'); | ||
|
||
module.exports = { | ||
plugins: [ | ||
autoprefixer, | ||
purgecss, | ||
rtlcss, | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const stats = './hugo_stats.json'; | ||
const fs = require('fs'); | ||
fs.access(stats, fs.F_OK, (err) => { | ||
if (err) { | ||
throw new Error('Hugo stats file not found, please turn on the "build.writeStats". See also https://hbs.razonyang.com/v1/en/docs/getting-started/prerequisites/#configuration.') | ||
} | ||
}); | ||
const purgecss = require('@fullhuman/postcss-purgecss')({ | ||
content: [ stats, "./extra_stats.json" ], | ||
defaultExtractor: (content) => { | ||
let els = JSON.parse(content).htmlElements; | ||
return els.tags.concat(els.classes, els.ids); | ||
}, | ||
safelist: { | ||
standard: [ | ||
'active', | ||
'bottom-0', | ||
'btn-primary', 'btn-outline-primary', | ||
'col-lg-10', | ||
'd-flex', | ||
'end-0', | ||
'fs-lg', 'fs-sm', 'fs-xl', 'fs-xs', 'fst-italic', | ||
'justify-content-center', | ||
'mb-0', | ||
'offcanvas-backdrop', | ||
'opacity-0', 'opacity-50', 'opacity-100', | ||
'p-1', 'pe-3', 'pt-0', 'pt-1', 'px-3', 'py-2', 'position-absolute', 'position-fixed', 'position-relative', 'position-sticky', | ||
'rounded', 'rounded-top', | ||
'show', | ||
'text-pre-wrap', 'text-uppercase', 'text-white', 'top-0', 'text-bg-secondary', 'text-success', | ||
'user-select-all', | ||
'w-100', | ||
'was-validated', | ||
], | ||
// deep: [/blue$/], | ||
greedy: [/carousel-indicators$/] | ||
}, | ||
dynamicAttributes: ['data-bs-popper', 'data-theme', 'data-palette', 'role'] | ||
}); | ||
|
||
exports.default = purgecss; |