Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit c6db15a

Browse files
author
Marlow Payne
authored
Merge pull request #102 from mobify/add-csscomb
Add CSSComb doc
2 parents fd1a7e8 + 34ac9e3 commit c6db15a

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

assets/csscomb.gif

57.8 KB
Loading

css/Readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@
4545
* [Sass-Lint](sass-lint/readme.md)
4646
* [Using Sass-Lint with Atom](sass-lint/readme.md#using-sass-lint-with-atom)
4747
* [Using Sass-Lint with Sublime Text](sass-lint/readme.md#using-sass-lint-with-sublime-text)
48+
* [CSSComb](csscomb/readme.md)
49+
* [Using CSSComb with Atom](csscomb/readme.md#atom)
50+
* [Using CSSComb with Sublime Text](csscomb/readme.md#sublime-text)
4851

4952
Continue on to [the Introduction →](introduction#introduction)

css/css-best-practices/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Another benefit is that this keeps our code isolated really well. Action Bar can
177177

178178
We want our CSS to be written consistently no matter who the code author is. In order to do so, please follow these below rules.
179179

180-
Note that we use [SCSS-Lint](https://github.com/causes/scss-lint) to make this easier — see our linting rules [here](https://github.com/mobify/mobify-code-style/blob/update-css-style/css/.scss-lint.yml).
180+
Note that we use [Sass-Lint](https://github.com/sasstools/sass-lint) to make this easier — see our linting rules [here](https://github.com/mobify/mobify-code-style/blob/develop/css/.sass-lint.yml). Find out how to integrate Sass-Lint with your text editor [here](../sass-lint/readme.md).
181181

182182
* One selector per line
183183
* Use a soft indent of four spaces
@@ -216,7 +216,7 @@ Note that we use [SCSS-Lint](https://github.com/causes/scss-lint) to make this e
216216

217217
Following our practice of writing consistent code, we also want all properties to be consistently ordered according to the bellow standard.
218218

219-
And as before, we use [SCSS-Lint](https://github.com/causes/scss-lint) to help ensure property order is consistent - see our linting rules [here](https://github.com/mobify/mobify-code-style/blob/update-css-style/css/.scss-lint.yml).
219+
And as before, we use [Sass-Lint](https://github.com/sasstools/sass-lint) to help ensure property order is consistent - see our linting rules [here](https://github.com/mobify/mobify-code-style/blob/develop/css/.sass-lint.yml).
220220

221221
1. Extends
222222
1. Mixins/Includes (except for property specific mixins)

css/csscomb/readme.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# CSSComb
2+
3+
A [CSS-beautifier utility](http://csscomb.com/) which will ensure that your SCSS is consistent with our [code style](https://github.com/mobify/mobify-code-style/blob/develop/css/.csscomb.json).
4+
5+
![CSSComb in action](../../assets/csscomb.gif "CSSComb in action")
6+
7+
## How to Install CSSComb
8+
9+
### Prerequisites
10+
* Install Node.js and NPM with NVM as directed in the [Adaptive.js docs](http://adaptivejs.mobify.com/v2.0/docs/install/)
11+
* Install CSSComb and the Mobify Code Style:
12+
13+
`npm install -g csscomb mobify-code-style`
14+
15+
### Atom
16+
1. Install [css-comb package](https://atom.io/packages/css-comb) for Atom (this will allow you to set the global CSSComb config)
17+
1. Open your Atom package settings for "css-comb" (**not** "csscomb")
18+
* Ensure your custom config path is set to your machine's version of `mobify-code-style`: Run `npm config get prefix` and append `/lib/node_modules/mobify-code-style/css/.csscomb.json` to the result
19+
* Ensure Disable config searching is unchecked
20+
1. Restart Atom
21+
1. Start combing your Sass!
22+
23+
### Sublime Text
24+
25+
Before you start, make sure you have [Package Control](https://packagecontrol.io/installation) installed for Sublime Text.
26+
27+
1. Install [CSSComb for Sublime](https://packagecontrol.io/packages/CSScomb) (Search for "CSScomb" in Sublime's Package Control)
28+
1. CSSComb for Sublime will look for your config in your HOME directory, so make a symlink to the Mobify Code Style version (this way, updating the code style through NPM will automagically update the config for Sublime):
29+
30+
```bash
31+
cd ~
32+
ln -s /path/to/your/local/node_modules/mobify-code-style/css/.csscomb.json ./.csscomb.json
33+
```
34+
(Find your local path by running `npm config get prefix` and append `/lib/node_modules/mobify-code-style/css/.csscomb.json` to the result)
35+
1. Restart Sublime
36+
1. Start combing your Sass!

css/introduction/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ We follow a mixture of various methodologies include, but not limited to: SMACSS
1919
* [Spline](https://github.com/mobify/spline) is our library of Sass mixins and functions
2020
* [Stencil](https://github.com/mobify/stencil) (Deprecated – but a new 2.0 version is coming soon!) is our library or reusable UI patterns
2121
* [Sass-Lint](https://github.com/sasstools/sass-lint) is our preferred linter for `SCSS`. Our custom linting rules are found [here](https://github.com/mobify/mobify-code-style/blob/master/css/.sass-lint.yml)). Find out how to integrate Sass-Lint with your text editor [here](../sass-lint/readme.md).
22-
* [CSScomb](http://csscomb.com/) is a tool that can be plugged into most popular text editors that automatically formats your code! Our formatting ruleset can be found [here](https://github.com/mobify/mobify-code-style/blob/master/css/.csscomb.json)
22+
* [CSScomb](http://csscomb.com/) is a tool that can be plugged into most popular text editors that automatically formats your code! Our formatting ruleset can be found [here](https://github.com/mobify/mobify-code-style/blob/master/css/.csscomb.json). Find out how to integrate CSSComb with your text editor [here](../csscomb/readme.md).
2323

2424

2525
## Philosophy & Structure

0 commit comments

Comments
 (0)