Skip to content

Commit

Permalink
feat(h5): 完善 prefers-color-scheme dark 的匹配
Browse files Browse the repository at this point in the history
  • Loading branch information
StrivingRabbit committed Jan 9, 2024
1 parent 07a44de commit bd9aec6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/postcssSplitMediaPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const mediaQuerys = []
module.exports = {
splitMediaPlugin: function (root, result) {
root.walkAtRules(rule => {
if (rule.params.indexOf('prefers-color-scheme') !== -1) {
if (/prefers-color-scheme\s*:\s*dark/.test(rule.params)) {
root.removeChild(rule)

mediaQuerys.push(rule)
Expand Down

0 comments on commit bd9aec6

Please sign in to comment.