Skip to content

Commit

Permalink
refactor: Change SCSS files' directory name
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The directory name of the SCSS files has changed from `sass /` to `scss /`.
  • Loading branch information
ruedap committed Mar 27, 2018
1 parent 3410c8b commit 5091e6c
Show file tree
Hide file tree
Showing 158 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ https://github.com/ruedap/go-emma
SCSS:

``` scss
@import "emma.css/sass/all";
@import "emma.css/scss/all";
```

CSS output:
Expand All @@ -116,7 +116,7 @@ You can add prefix to utility classes by `$emma-prefix` variable:

``` scss
$emma-prefix: "u-"; // Set prefix
@import "emma.css/sass/all";
@import "emma.css/scss/all";
```
CSS output:
``` css
Expand All @@ -132,7 +132,7 @@ You can remove `!important` annotations by `$emma-important` variable:

``` scss
$emma-important: false; // Remove !important annotations
@import "emma.css/sass/all";
@import "emma.css/scss/all";
```
CSS output:
``` css
Expand All @@ -144,12 +144,12 @@ CSS output:

### Change default sizes or colors

You can change default sizes or colors by [variables](sass/_vars.scss):
You can change default sizes or colors by [variables](scss/_vars.scss):

``` scss
$emma-padding-md: 20px; // default: `1.0rem`
$emma-color-black: #000; // default: `#111111`
@import "emma.css/sass/all";
@import "emma.css/scss/all";
```


Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"description": "Emma.css { emmet-like utility classes }",
"scripts": {
"build": "npm run clean && npm run test && npm run compile",
"clean": "rimraf tmp/ sass/ && mkdirp tmp/",
"clean": "rimraf tmp/ scss/ && mkdirp tmp/",
"convert:data": "js-yaml src/emma-data.yml > tmp/emma-data.json",
"convert:schema": "js-yaml src/emma-schema.yml > tmp/emma-schema.json",
"validate:json": "ajv -s tmp/emma-schema.json -d tmp/emma-data.json",
"compile:json": "npm run convert:data && npm run convert:schema && npm run validate:json",
"format:ts": "prettier --write src/*.ts test/*.ts",
"compile:ts": "npm run format:ts && tsc",
"compile:js": "node tmp/index.js",
"format:sass": "prettier --write sass/**/*.scss",
"compile:sass": "node-sass --output-style compact ./sass/all.scss ./emma.css && npm run format:sass",
"compile": "npm run compile:json && npm run compile:ts && npm run compile:js && npm run compile:sass && npm run remove-empty-lines",
"format:scss": "prettier --write scss/**/*.scss",
"compile:scss": "node-sass --output-style compact ./scss/all.scss ./emma.css && npm run format:scss",
"compile": "npm run compile:json && npm run compile:ts && npm run compile:js && npm run compile:scss && npm run remove-empty-lines",
"remove-empty-lines": "gulp remove-empty-lines",
"watch": "watch 'npm run test' src/ test/ --wait 10 -d -u",
"test": "npm run compile:json && mocha",
Expand All @@ -24,8 +24,8 @@
"license": "MIT",
"main": "emma.css",
"style": "emma.css",
"scss": "sass/all.scss",
"files": ["sass", "CHANGELOG.md", "emma.css", "LICENSE", "README.md"],
"scss": "scss/all.scss",
"files": ["scss", "CHANGELOG.md", "emma.css", "LICENSE", "README.md"],
"homepage": "https://github.com/ruedap/emma.css",
"keywords": ["sass", "scss", "css", "emmet", "utility", "coding"],
"bugs": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/emma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export type TEmmaDoc = {
export default class Emma {
readonly PREFIX_VAR;
readonly PREFIX_MIXIN;
readonly SASS_DIR = "sass";
readonly SCSS_DIR = "scss";
readonly TEMP_DIR = "tmp";
readonly VAR_FILE = "vars";
readonly MIXIN_FILE = "mixins";
Expand All @@ -63,7 +63,7 @@ export default class Emma {
const props = this.emmaDoc.rules.props;

// Make dir
fs.ensureDirSync(`${this.SASS_DIR}/${this.RULE_FILE}`);
fs.ensureDirSync(`${this.SCSS_DIR}/${this.RULE_FILE}`);

// Vars
this.writeFileSync(`_${this.VAR_FILE}`, this.generateVars(vars));
Expand Down Expand Up @@ -267,11 +267,11 @@ export default class Emma {
}

private writeFileSync(filename: string, str: string): void {
fs.writeFileSync(`${this.SASS_DIR}/${filename}.scss`, str);
fs.writeFileSync(`${this.SCSS_DIR}/${filename}.scss`, str);
}

private appendFileSync(filename: string, str: string): void {
fs.appendFileSync(`${this.SASS_DIR}/${filename}.scss`, str);
fs.appendFileSync(`${this.SCSS_DIR}/${filename}.scss`, str);
}

private loadEmmaDoc(filename: string = this.EMMA_JSON): TEmmaDoc {
Expand Down
4 changes: 2 additions & 2 deletions test/emma.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ describe("Emma", () => {
const fsMock = sinon.mock(fs);
fsMock
.expects("writeFileSync")
.withArgs("sass/foo.scss", "bar")
.withArgs("scss/foo.scss", "bar")
.exactly(1);

emma.writeFileSync("foo", "bar");
Expand All @@ -292,7 +292,7 @@ describe("Emma", () => {
const fsMock = sinon.mock(fs);
fsMock
.expects("appendFileSync")
.withArgs("sass/foo.scss", "bar")
.withArgs("scss/foo.scss", "bar")
.exactly(1);

emma.appendFileSync("foo", "bar");
Expand Down

0 comments on commit 5091e6c

Please sign in to comment.