-
Notifications
You must be signed in to change notification settings - Fork 516
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
chore(theme): SASS-based themes #322
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c8dbfd3
chore(theme): SASS-based themes
redox e4a749d
chore(sass): add a `bem` mixin that does everything without nesting
redox f75996c
chore(sass): extract variables + organize default theme with a sub-fo…
redox 4770961
Merge branch 'develop' into sass-theme
redox 74e8ea3
chore(dev): watch the SASS files as well during development
redox 313d5e1
Merge branch 'develop' into sass-theme
redox 852e2ad
chore(priceRanges): add default theme skeleton
redox f2f0a0e
chore(theme): prepend the version+license to the themes. Fix #341
redox 2bead52
Merge branch 'develop' into sass-theme
redox 585d9a1
Merge branch 'develop' into sass-theme
redox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1 +1 @@ | ||
../themes/default.css | ||
../dist/themes/default.css |
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ev # exit when error | ||
|
||
npm install | ||
node-sass -o ./dist/themes/ --watch ./themes & | ||
webpack-dev-server --config webpack.example.config.js --hot --inline --no-info & | ||
wait |
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,20 @@ | ||
@mixin component($component) | ||
.ais-#{$component} | ||
@content | ||
|
||
@mixin modifier($modifier) | ||
&--#{$modifier} | ||
@content | ||
|
||
@mixin element($element) | ||
&__#{$element} | ||
@content | ||
|
||
@mixin bem($component, $modifier, $element: '') | ||
+component($component) | ||
+modifier($modifier) | ||
@if $element != '' | ||
+element($element) | ||
@content | ||
@else | ||
@content |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@import "base" | ||
|
||
@import "default/search-box" | ||
@import "default/stats" | ||
@import "default/index-selector" | ||
@import "default/hits" | ||
@import "default/pagination" | ||
@import "default/refinement-list" | ||
@import "default/menu" | ||
@import "default/toggle" | ||
@import "default/hierarchical-menu" | ||
@import "default/range-slider" | ||
@import "default/price-ranges" |
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,14 @@ | ||
@import '../base' | ||
@import 'variables' | ||
|
||
+component(hierarchical-menu) | ||
+modifier(header) | ||
+modifier(body) | ||
+modifier(list) | ||
+element(lvl0) | ||
+element(lvl1) | ||
+modifier(item) | ||
+element(active) | ||
+modifier(link) | ||
+modifier(count) | ||
+modifier(footer) |
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,6 @@ | ||
@import '../base' | ||
@import 'variables' | ||
|
||
+component(hits) | ||
+element(empty) | ||
+modifier(item) |
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,5 @@ | ||
@import '../base' | ||
@import 'variables' | ||
|
||
+component(index-selector) | ||
+modifier(item) |
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 @@ | ||
@import '../base' | ||
@import 'variables' | ||
|
||
+component(menu) | ||
+modifier(header) | ||
+modifier(body) | ||
+modifier(list) | ||
+modifier(item) | ||
+element(active) | ||
+modifier(link) | ||
+modifier(count) | ||
+modifier(footer) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you use that?
Hmm, the goal of BEM is to not have to do any nesting. Sass can let you easily do a lot of nesting, but we should actually never nest more than 2 or 3 levels deep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, the good thing it that is doesn't nest anything :) The nesting is just use to build the class names from the parent using that
&--
and&__
syntax.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. I did not know that syntax.
I'm not sure the end result in Sass will be any more readable than plain CSS, though :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, no-brainer :)
VS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, my point exactly. I find the first one easier to read :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you can use the other mixin: