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

Use actual colors in SASS variables. Rework of #1542. #4167

Merged
merged 1 commit into from
Mar 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 14 additions & 6 deletions docs/_assets/customizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,20 @@ MaterialCustomizer = (function() {
var primaryDark = this.getColor(primaryColor, '700');
var accent = this.getColor(secondaryColor, 'A200');

return this.replaceDict(this.template, {
'\\$color-primary-dark': primaryDark,
'\\$color-primary-contrast': this.calculateTextColor(primary),
'\\$color-accent-contrast': this.calculateTextColor(accent),
'\\$color-primary': primary,
'\\$color-accent': accent
var initial = this.replaceDict(this.template, {
'rgba\\(\\#primdark': 'rgba(' + primaryDark,
'rgba\\(\\#primcontrast': 'rgba(' + this.calculateTextColor(primary),
'rgba\\(\\#acccontrast': 'rgba(' + this.calculateTextColor(accent),
'rgba\\(\\#primary': 'rgba(' + primary,
'rgba\\(\\#accent': 'rgba(' + accent
});

return this.replaceDict(initial, {
'\\#primdark': 'rgb(' + primaryDark + ')',
'\\#primcontrast': 'rgb(' + this.calculateTextColor(primary) + ')',
'\\#acccontrast': 'rgb(' + this.calculateTextColor(accent) + ')',
'\\#primary': 'rgb(' + primary + ')',
'\\#accent': 'rgb(' + accent + ')'
});
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"gulp-concat": "^2.4.1",
"gulp-connect": "^2.2.0",
"gulp-css-inline-images": "^0.1.1",
"gulp-csso": "^1.0.0",
"gulp-csso": "^1.1.0",
"gulp-file": "^0.2.0",
"gulp-flatten": "^0.2.0",
"gulp-front-matter": "^1.2.2",
Expand Down
Loading