forked from Daemonite/material
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
119 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
layout: docs | ||
title: Dark theme | ||
description: A dark theme is a low-light UI that displays mostly dark surfaces. | ||
group: material | ||
darkmode: true | ||
--- | ||
|
||
<div class="list-group my-2 my-lg-5"> | ||
<a href="https://material.io/design/color/dark-theme.html" target="_blank" class="list-group-item list-group-item-action d-flex font-weight-bold"> | ||
<span class="list-group-item-icon lgi-icon-md"></span> | ||
Material Design guidelines: Dark theme</a> | ||
<a href="#" target="_blank" class="list-group-item disabled d-flex font-weight-bold"> | ||
<span class="list-group-item-icon lgi-icon-mdc"></span> | ||
Material Components for the web: Dark Theme (planned)</a> | ||
</div> | ||
|
||
A dark theme displays dark surfaces across the majority of a UI. It's designed to be a supplemental mode to a default (or light) theme. | ||
|
||
Material uses a very simple Dark theme for the moment, based on a `filter()` CSS effect. | ||
|
||
Dark mode is applied in 2 conditions: | ||
|
||
1. If users's browser is set to Dark mode preference using `@media (prefers-color-scheme: dark)` media query. | ||
2. If `data-theme="dark"` is added to the opening `html` tag like this: `<html lang="en" data-theme="dark">`. | ||
|
||
More improvements for the Dark mode will be added in next versions. | ||
|
||
## Live demo | ||
|
||
Only working on a standard light mode environment (doesn't work if browser is in dark mode). | ||
|
||
<div class="bd-example px-5"> | ||
<div class="custom-control custom-switch"> | ||
<input type="checkbox" class="custom-control-input" id="darkSwitch" checked> | ||
<label class="custom-control-label" for="darkSwitch">Toggle Dark mode</label> | ||
</div> | ||
<script> | ||
const Tag = document.documentElement | ||
const Switch = document.getElementById("darkSwitch") | ||
Tag.dataset.theme = 'dark' | ||
Switch.addEventListener("click", () => { | ||
Switch.checked ? Tag.dataset.theme = 'dark' : Tag.dataset.theme = '' | ||
}) | ||
</script> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.