Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dark mode variant #2279

Merged
merged 4 commits into from
Sep 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix lint warnings
  • Loading branch information
adamwathan committed Sep 1, 2020
commit b4ee918856a5c4d3aa497c665193ba52e0de4261
5 changes: 3 additions & 2 deletions src/flagged/darkModeVariant.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _ from 'lodash'
import selectorParser from 'postcss-selector-parser'
import buildSelectorVariant from '../util/buildSelectorVariant'
import defaultConfig from '../../defaultConfig'
Expand Down Expand Up @@ -28,7 +27,7 @@ export default {
})
mediaQuery.append(modified)
container.append(mediaQuery)
return
return container
}

if (config('dark') === 'class') {
Expand All @@ -40,6 +39,8 @@ export default {
})
return modifySelectors(({ selector }) => parser.processSync(selector))
}

throw new Error("The `dark` config option must be either 'media' or 'class'.")
})
},
],
Expand Down