-
Notifications
You must be signed in to change notification settings - Fork 163
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
Theme switch in examples #5022
Theme switch in examples #5022
Changes from 3 commits
dad31b9
9ecca3b
8bed1f9
a25ebc3
d09e9cf
c7a98eb
fdd9015
12bee2c
2be7bbc
71c52bf
608dc11
562ed91
68a33d5
0197111
27bd3e6
7de48ab
b7fc5af
6e657c3
dd850a2
19956b7
c6f2228
c33e881
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@import 'settings'; | ||
|
||
@mixin vf-u-theme-toggle { | ||
.u-theme-toggle { | ||
bottom: $spv--x-large; | ||
position: fixed; | ||
right: $sp-unit * 30; | ||
z-index: 100; | ||
|
||
.u-theme-toggle__button { | ||
border: 0; | ||
margin: 0; | ||
} | ||
|
||
.u-theme-toggle__dark { | ||
background-color: $colors--dark-theme--background-default; | ||
color: $colors--dark-theme--text-default; | ||
} | ||
|
||
.u-theme-toggle__light { | ||
background-color: $colors--light-theme--background-default; | ||
color: $colors--light-theme--text-default; | ||
} | ||
.u-theme-toggle__paper { | ||
background-color: $color-paper; | ||
color: $color-x-dark; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,13 @@ | |
|
||
{% block standalone_css %}patterns_buttons{% endblock %} | ||
|
||
{% set is_dark = True %} | ||
{% block content %} | ||
<div class="p-strip is-dark is-shallow" style="background: #111"> | ||
<button class="p-button is-dark">Default button</button> | ||
<button class="p-button--base is-dark">Base button</button> | ||
<button class="p-button--positive is-dark">Positive button</button> | ||
<button class="p-button--negative is-dark">Negative button</button> | ||
<button class="p-button--brand is-dark">Brand button</button> | ||
<div class="p-strip is-shallow"> | ||
<button class="p-button">Default button</button> | ||
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'm not sure if that works, because buttons have not been migrated to new theming yet, so they need to have You can keep the Overall, the |
||
<button class="p-button--base">Base button</button> | ||
<button class="p-button--positive">Positive button</button> | ||
<button class="p-button--negative">Negative button</button> | ||
<button class="p-button--brand">Brand button</button> | ||
</div> | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,9 @@ | |
|
||
{% block standalone_css %}patterns_lists{% endblock %} | ||
|
||
{% set is_dark = True %} | ||
{% block content %} | ||
<div class="p-strip is-dark"> | ||
<div class="p-strip"> | ||
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. You can remove the strip completely, it was only there to make backround dark. |
||
|
||
<ol class="p-stepped-list"> | ||
<li class="p-stepped-list__item"> | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,15 +3,7 @@ | |||||
|
||||||
{% block standalone_css %}patterns_logo-section{% endblock %} | ||||||
|
||||||
{% block style %} | ||||||
<style> | ||||||
body { | ||||||
background: #262626; | ||||||
color: #FFF; | ||||||
} | ||||||
</style> | ||||||
{% endblock %} | ||||||
|
||||||
{%set is_dark = True%} | ||||||
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. Just a bit of missing whitespace for consistency
Suggested change
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. As you mentioned in the comment, this is tricky one because if images. We can't change images based on the theme, we don't have a solution for it (outside of built in icons). We can't change src based on theme or anything, at least not easily. So I guess it's ok to just keep this one dark, with switch not working. |
||||||
{% block content %} | ||||||
<div class="u-fixed-width"> | ||||||
<div class="p-logo-section"> | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,12 @@ | |
|
||
{% block standalone_css %}patterns_rule{% endblock %} | ||
|
||
{% set is_dark = True %} | ||
{% block content %} | ||
|
||
<div class="p-strip is-dark"> | ||
<div class="p-strip"> | ||
<div class="u-fixed-width p-section--shallow"> | ||
<hr class="p-rule--highlight is-dark"> | ||
<hr class="p-rule--highlight"> | ||
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. This will also not work, the rule component does not support new theming yet, so it will not inherit the theme. It needs to have So the switch will not work here yet, please revert this example. |
||
<h2> | ||
<strong> | ||
A broad portfolio. | ||
|
@@ -18,16 +19,16 @@ <h2> | |
<div class="p-section--shallow"> | ||
<div class="row--25-75"> | ||
<div class="col"> | ||
<hr class="p-rule is-dark"> | ||
<hr class="p-rule"> | ||
<div class="row"> | ||
<div class="col-6"> | ||
<h2>One stable platform <br>for everything open source</h2> | ||
<p>Build with confidence using the world's favourite Linux operating system. <br>Ubuntu delivers long-term supported releases every two years.</p> | ||
</div> | ||
<div class="col-3"> | ||
<h2><a class="p-link is-dark" href="#">Desktop ›</a></h2> | ||
<hr class="p-rule--muted is-dark u-hide--medium"> | ||
<h2><a class="is-dark" href="#">Server ›</a></h2> | ||
<h2><a class="p-link" href="#">Desktop ›</a></h2> | ||
<hr class="p-rule--muted u-hide--medium"> | ||
<h2><a href="#">Server ›</a></h2> | ||
</div> | ||
</div> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
{% set is_paper = true %} | ||
{% block content %} | ||
<div class="p-strip is-dark"> | ||
<div class="p-strip"> | ||
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. This example is used in the docs to show how to make strip dark, so in this case we want the So for now it's ok that theme switch will not work (or will not be available) on this example. |
||
<div class="row--25-75"> | ||
<div class="col"> | ||
<h2>Dark strip</h2> | ||
|
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 didn't have to do this, thanks :)
I think by mistake you removed the
.is-accent
version. I don't think we have separate themed accent colour, so for now just keep it as is, regardless of the theme.