-
Notifications
You must be signed in to change notification settings - Fork 2.1k
chore(demos): Add example themes & load theme from URL #1967
Conversation
To test, visit the following URL: http://localhost:8080/theme/index.html?theme=dark The `theme` param must be one of `baseline`, `black`, `dark`, `white`, or `yellow`.
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.
I don't think I understand all the complexity of theme-loader.js and uri.js ... are you doing some security protection? (Can we just use a Node module instead of uri.js?? Something open source?)
demos/theme/theme-baseline.scss
Outdated
|
||
@import "../../packages/mdc-theme/color-palette"; | ||
|
||
$demo-toolbar-progress-bar-color: secondary-light; |
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.
Put a TODO here to remove this once all components use baseline as a default
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.
Done
demos/theme/theme-black.scss
Outdated
@import "../../packages/mdc-theme/color-palette"; | ||
|
||
$mdc-theme-primary: $material-color-grey-900; | ||
$mdc-theme-secondary: $material-color-light-green-a700; |
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.
Put a TODO here to call Sass mixins instead of using mdc-theme-primary and mdc-theme-secondary
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.
Done
demos/theme/theme-dark.scss
Outdated
|
||
$mdc-theme-primary: $material-color-amber-300; | ||
$mdc-theme-secondary: $material-color-pink-400; | ||
$mdc-theme-background: $material-color-grey-900; |
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.
Put a TODO here to call Sass mixins instead of using mdc-theme-primary, mdc-theme-secondary, and mdc-theme-background
Also, call the Sass mixins for the checkbox so that the demo example on theme=dark is a yellow checkbox (or pink, whatevs)
And call the Sass mixins for the radio button, the select, the tabs, and the text field (most of those mixins are written, so just use whatever is there)
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.
Done.
Select and Tabs don't have theme mixins yet, so I left a TODO for those.
demos/theme/theme-white.scss
Outdated
@import "../../packages/mdc-theme/color-palette"; | ||
|
||
$mdc-theme-primary: #fff; | ||
$mdc-theme-secondary: $material-color-orange-500; |
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.
Put a TODO here to call Sass mixins instead of using mdc-theme-primary and mdc-theme-secondary
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.
Done
demos/theme/theme-yellow.scss
Outdated
@import "../../packages/mdc-theme/color-palette"; | ||
|
||
$mdc-theme-primary: $material-color-yellow-500; | ||
$mdc-theme-secondary: $material-color-blue-500; |
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.
Put a TODO here to call Sass mixins instead of using mdc-theme-primary and mdc-theme-secondary
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.
Done
I considered using existing Node modules for this, but A) I don't trust them to be secure, and B) they're all big and bloated, and since this script is going in the I tried to follow the patterns employed by Closure lib's |
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.
LGTM, two comments left
demos/theme/theme-baseline.scss
Outdated
|
||
@import "../../packages/mdc-theme/color-palette"; | ||
|
||
// TODO(acdvorak): Use theme mixin(s) instead |
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.
don't put your name here...that implies you are going to do all this work very soon. While in reality it will probably be many people over several months.
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.
Done
demos/theme/theme-dark.scss
Outdated
@include mdc-theme-prop(color, text-primary-on-dark); | ||
} | ||
|
||
// TODO(acdvorak): Call theme mixins for mdc-select and mdc-tab-bar. |
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.
You can call some mixins for tabs. they are under mdc-tabs/tab/_mixins: mdc-tab-ink-color or mdc-tab-label-ink-color and mdc-tab-icon-ink-color.
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.
Not sure how I missed those. Thanks!
# Conflicts: # demos/theme/index.html
…ents/material-components-web into chore/demos/theme-loader
commit f399384 Author: Andrew C. Dvorak <[email protected]> Date: Tue Jan 16 20:09:43 2018 -0800 chore(demos): Add example themes & load theme from URL (#1967) To test, visit the following URL: http://localhost:8080/theme/index.html?theme=dark The `theme` param must be one of `baseline`, `black`, `dark`, `white`, or `yellow`. This only works on the theme demo page; all other demo pages are unaffected. commit 1dae53c Author: Will Ernest <[email protected]> Date: Tue Jan 16 19:14:54 2018 -0800 feat(text-field): Move text-field outline colors to mixins (#1963) * feat(text-field): Move color mixins for outline/helper text. Update demos/docs Breaking Change: Moves color customization of the outline text-field to SASS mixins.
To test, visit the following URL:
http://localhost:8080/theme/index.html?theme=dark
The
theme
param must be one ofbaseline
,black
,dark
,white
, oryellow
.This only works on the theme demo page; all other demo pages are unaffected.