-
Notifications
You must be signed in to change notification settings - Fork 2.1k
chore(theme): remove dark theme #2169
Changes from 6 commits
5067fd3
ad6e791
9443612
0675d70
5f6e9ec
016517f
eb21814
e15c709
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -430,37 +430,35 @@ Since our cards only contain text and no components, let's keep it simple for no | |
> Note: in the future we plan to provide a Javascript utility method for changing all derived colors and making this | ||
use-case easier. | ||
|
||
## Custom Sass Mixins | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Custom Sass Mixins -> Custom Themes |
||
|
||
## Dark Themes | ||
We also have provided a way to customize on a per component basis. We realize that you may want a button with a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be okay to focus on a single example here, and use Lead off with something like, "For example, let's say you want to make particular buttons stand out by changing their fill color." |
||
blue background and another with a red background on the same page. Each component's package is documented with all | ||
our provided sass mixins and what arguments to pass them. For example, here is a link to our [Button Sass Mixins docs](https://github.com/material-components/material-components-web/tree/master/packages/mdc-button#advanced-sass-mixins). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
Beyond what we've covered in this document so far, there's also the concept of a _dark theme_. All MDC Web components have | ||
been designed to work with both light themes (that assume a light-colored background) and dark themes (with dark-colored | ||
backgrounds), but the default is always light. | ||
If we continue the example stated above, here is what the sass would like: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rephrase to "Here is an example of how we could add styles to change the color of some buttons:" (For some reason when I read "the example stated above", I was thinking it was referring to further above this section of the document, rather than just a paragraph ago) |
||
|
||
> Note: When using a dark theme, you probably want to choose a dark color as the background for your page, and adjust | ||
the MDC Web `background` color to match. | ||
|
||
In order to apply a dark theme to a single element, you can use its `--theme-dark` class. For example, for a button: | ||
```css | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/css/scss/ |
||
.red-bg-button { | ||
@include mdc-button-container-fill-color(red); | ||
} | ||
|
||
```html | ||
<button class="mdc-button mdc-button--raised mdc-button--theme-dark"> | ||
Raised dark button | ||
</button> | ||
.blue-bg-button { | ||
@include mdc-button-container-fill-color(blue); | ||
@include mdc-button-ink-color(white); // for better contrast | ||
} | ||
``` | ||
|
||
Alternatively, you can set your entire page (or a portion of it) to a dark theme by using the `mdc-theme--dark` class: | ||
Html Markup would then look like: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Then apply the custom class to some of our buttons, like so:" |
||
|
||
```html | ||
<section class="mdc-theme--dark"> | ||
<button class="mdc-button mdc-button--raised"> | ||
Still dark | ||
</button> | ||
|
||
<button class="mdc-button"> | ||
Me too! | ||
</button> | ||
</section> | ||
``` | ||
<button class="mdc-button red-bg-button"> | ||
<i class="material-icons mdc-button__icon">favorite</i> | ||
Button | ||
</button> | ||
|
||
> Note: there's currently no way to set a light portion inside of a dark one, so if you want to achieve that effect | ||
you'll need to selectively apply dark classes to everything except the light bits. | ||
<button class="mdc-button blue-bg-button"> | ||
<i class="material-icons mdc-button__icon">favorite</i> | ||
Button | ||
</button> | ||
``` |
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.
Also remove $dark-button-color which is no longer used after this is removed