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

Finish CSS Basics #8

Merged
merged 14 commits into from
Jul 27, 2016
Merged

Finish CSS Basics #8

merged 14 commits into from
Jul 27, 2016

Conversation

mattboon
Copy link
Contributor

@mattboon mattboon commented Jul 27, 2016

Sass

Adds Sass to project for much easier theming and variables management. css-modules-values and postcss-theme turned out not to be flexible enough right now.

Refer to these to find out why:

Adds sass-loader configured in webpack.config with extensions param added to babel.server for requiring on the server.

Use of CSS Modules remains

Linting

Replaces stylelint with scss-lint and standard Espi .scss-lint.yml config file. Adjusts pre-commit hook.

Variables

Adds base manifest for global variables that are imported into components. All use the !default prefix. Added an overrides placeholder which the user can include in their theme to over-write any variables for their custom theme.

Theming

When the user declares a THEME_PATH in .env we see the user's theme:

screen shot 2016-07-27 at 13 42 35

And without .env, the default theme:

screen shot 2016-07-27 at 13 41 49

Variables now extend the defaults, so the user can customise as much or as little as they want via the styles/_overrides.scss file in their theme directory.

This is done by changing the webpack config when the user declares a theme, so sass-loader looks in the user's theme directory first. Neat.

@@ -11,7 +11,7 @@ This project requires node `>= 4.0.0` due to [hapi](https://github.com/hapijs/ha

### Global packages

[Stylelint](https://github.com/stylelint/stylelint) must be installed globally before making CSS changes in the codebase.
[scss-lint](https://github.com/brigade/scss-lint) must be installed globally before making Sass / CSS changes in the codebase.

```sh
$ npm install -g stylelint

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is off.

@mattboon mattboon changed the title [RFR] Finish CSS Basics Finish CSS Basics Jul 27, 2016
@mattboon mattboon merged commit 14c343e into develop Jul 27, 2016
@mattboon mattboon deleted the feature/144-finish-css-basics branch August 12, 2016 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants