Skip to content

Commit 5aaec33

Browse files
committed
feat(docs): "dark" as brand color
1 parent 2e1e0a0 commit 5aaec33

File tree

16 files changed

+81
-27
lines changed

16 files changed

+81
-27
lines changed

docs/src/assets/menu.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const gettingStarted = [
4444
},
4545
{
4646
name: 'VS Code Configuration',
47-
badge: 'new',
4847
path: 'vs-code-configuration'
4948
}
5049
]
@@ -181,7 +180,6 @@ const cli = [
181180
},
182181
{
183182
name: 'CSS Preprocessors',
184-
badge: 'new',
185183
path: 'css-preprocessors'
186184
},
187185
{
@@ -483,7 +481,6 @@ const style = [
483481
},
484482
{
485483
name: 'Theme Builder',
486-
badge: 'new',
487484
path: 'theme-builder'
488485
},
489486
{
@@ -513,7 +510,6 @@ const style = [
513510
},
514511
{
515512
name: 'Sass/SCSS Variables',
516-
badge: 'new',
517513
path: 'sass-scss-variables'
518514
},
519515
{
@@ -550,7 +546,6 @@ const layout = [
550546
},
551547
{
552548
name: 'Flex Playground',
553-
badge: 'new',
554549
path: 'flex-playground'
555550
}
556551
]
@@ -577,13 +572,11 @@ const layout = [
577572
},
578573
{
579574
name: 'Layout Builder',
580-
badge: 'new',
581575
external: true,
582576
path: '/layout-builder'
583577
},
584578
{
585579
name: 'Layout Gallery',
586-
badge: 'new',
587580
path: 'gallery'
588581
},
589582
{
@@ -1273,7 +1266,7 @@ module.exports = [
12731266
path: 'quasar-utils',
12741267
children: utils
12751268
}
1276-
1269+
12771270
/*
12781271
// FIREBASE DOCS: UNCOMMENT WHEN READY TO RELEASE
12791272
,{

docs/src/components/HeaderMenu.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ div
5151
q-icon(name="style")
5252
q-item-section Theme Builder
5353

54+
q-item(clickable, to="/style/dark-mode")
55+
q-item-section(avatar)
56+
q-icon(name="invert_colors")
57+
q-item-section
58+
.row.no-wrap.items-center
59+
span Dark Mode
60+
q-badge.q-ml-sm new
61+
5462
q-item(clickable, tag="a", href="/layout-builder", target="_blank")
5563
q-item-section.text-primary(avatar)
5664
q-icon(name="dashboard")

docs/src/components/page-parts/color-palette/BrandColors.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default {
1919
'primary',
2020
'secondary',
2121
'accent',
22+
'dark',
2223
'positive',
2324
'negative',
2425
'info',

docs/src/components/page-parts/theming/ThemeBuilder.vue

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@
3030
q-toolbar
3131
q-btn(flat, dense, round, icon="arrow_back")
3232
q-space
33+
q-toggle.q-mr-sm(dense, v-model="darkMode", :dark="dark.primary", color="red", label="Dark mode")
3334
q-btn(flat, dense, round, icon="search")
3435
q-btn(flat, dense, round, icon="menu")
3536

3637
q-toolbar(inset)
3738
q-toolbar-title Quasar
3839

39-
.q-px-md.q-py-lg
40+
.q-px-md.q-py-lg(:class="pageClass")
4041
.row.q-col-gutter-md
4142
.col-12.col-sm-6.col-md-4.col-lg-3(
4243
v-for="color in sideColors"
@@ -48,7 +49,7 @@
4849
.ellipsis.text-capitalize {{ color }}
4950
q-space
5051
q-icon(
51-
v-if="color !== 'secondary'"
52+
v-if="color !== 'secondary' && color !== 'dark'"
5253
:name="$q.iconSet.type[color]"
5354
size="24px"
5455
)
@@ -117,6 +118,7 @@ export default {
117118
primary: '#027BE3',
118119
secondary: '#26A69A',
119120
accent: '#9C27B0',
121+
dark: '#424242',
120122
121123
positive: '#21BA45',
122124
negative: '#C10015',
@@ -128,17 +130,19 @@ export default {
128130
primary: true,
129131
secondary: true,
130132
accent: true,
133+
dark: true,
131134
132135
positive: true,
133136
negative: true,
134137
info: false,
135138
warning: false
136139
},
137140
141+
darkMode: false,
138142
exportDialog: false,
139143
exportTab: 'sass',
140-
list: ['primary', 'secondary', 'accent', 'positive', 'negative', 'info', 'warning'],
141-
sideColors: ['secondary', 'positive', 'negative', 'info', 'warning']
144+
list: ['primary', 'secondary', 'accent', 'dark', 'positive', 'negative', 'info', 'warning'],
145+
sideColors: ['secondary', 'dark', 'positive', 'negative', 'info', 'warning']
142146
}
143147
},
144148
@@ -155,6 +159,10 @@ export default {
155159
this.update('accent', val)
156160
},
157161
162+
'colors.dark' (val) {
163+
this.update('dark', val)
164+
},
165+
158166
'colors.positive' (val) {
159167
this.update('positive', val)
160168
},
@@ -173,11 +181,18 @@ export default {
173181
},
174182
175183
computed: {
184+
pageClass () {
185+
return this.darkMode === true
186+
? 'bg-grey-10 text-white'
187+
: 'bg-white text-black'
188+
},
189+
176190
sassExport () {
177191
return `// src/css/quasar.variables.sass\n\n` +
178192
`$primary : ${this.colors.primary}\n` +
179193
`$secondary : ${this.colors.secondary}\n` +
180194
`$accent : ${this.colors.accent}\n\n` +
195+
`$dark : ${this.colors.dark}\n\n` +
181196
`$positive : ${this.colors.positive}\n` +
182197
`$negative : ${this.colors.negative}\n` +
183198
`$info : ${this.colors.info}\n` +
@@ -189,6 +204,7 @@ export default {
189204
`$primary : ${this.colors.primary};\n` +
190205
`$secondary : ${this.colors.secondary};\n` +
191206
`$accent : ${this.colors.accent};\n\n` +
207+
`$dark : ${this.colors.dark};\n\n` +
192208
`$positive : ${this.colors.positive};\n` +
193209
`$negative : ${this.colors.negative};\n` +
194210
`$info : ${this.colors.info};\n` +
@@ -200,6 +216,7 @@ export default {
200216
`$primary = ${this.colors.primary}\n` +
201217
`$secondary = ${this.colors.secondary}\n` +
202218
`$accent = ${this.colors.accent}\n\n` +
219+
`$dark = ${this.colors.dark}\n\n` +
203220
`$positive = ${this.colors.positive}\n` +
204221
`$negative = ${this.colors.negative}\n` +
205222
`$info = ${this.colors.info}\n` +
@@ -218,6 +235,8 @@ return {
218235
secondary: '${this.colors.secondary}',
219236
accent: '${this.colors.accent}',
220237
238+
dark: '${this.colors.dark}',
239+
221240
positive: '${this.colors.positive}',
222241
negative: '${this.colors.negative}',
223242
info: '${this.colors.info}',
@@ -238,6 +257,8 @@ window.quasarConfig = {
238257
secondary: '${this.colors.secondary}',
239258
accent: '${this.colors.accent}',
240259
260+
dark: '${this.colors.dark}',
261+
241262
positive: '${this.colors.positive}',
242263
negative: '${this.colors.negative}',
243264
info: '${this.colors.info}',
@@ -257,6 +278,8 @@ Vue.use(Quasar, {
257278
secondary: '${this.colors.secondary}',
258279
accent: '${this.colors.accent}',
259280
281+
dark: '${this.colors.dark}',
282+
260283
positive: '${this.colors.positive}',
261284
negative: '${this.colors.negative}',
262285
info: '${this.colors.info}',

docs/src/pages/introduction-to-quasar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Quasar comes equipped with over 40 language packs out of the box. On top of that
9393
And finally, it’s worth mentioning the significant amount of time taken to write great, bloat-free, focused and complete documentation, so that developers can quickly pick up Quasar. We put special effort into our documentation to be sure there is no confusion.
9494

9595
## Underlying technologies
96-
[Vue](https://vuejs.org/), [Nodejs](https://nodejs.org/), [Webpack](https://webpack.js.org/), [Cordova](https://cordova.apache.org/), [Electron](https://electronjs.org/).
96+
[Vue](https://vuejs.org/), [Nodejs](https://nodejs.org/), [Webpack](https://webpack.js.org/), [Cordova](https://cordova.apache.org/), [Capacitor](https://capacitor.ionicframework.com), [Electron](https://electronjs.org/).
9797

9898
Except for Vue, which takes half a day to pick up and will change you forever, there is no requirement for you to know the other technologies. They are all integrated and configured in Quasar for you.
9999

docs/src/pages/quasar-plugins/dark.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: Dark Plugin
33
desc: A Quasar plugin to toggle or configure the Dark Mode state of your app.
44
badge: v1.3+
5+
related:
6+
- /style/dark-mode
7+
- /style/theme-builder
58
---
69

710
::: tip

docs/src/pages/style/color-palette.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ Most of the colors that Quasar Components use are strongly linked with these thr
1212

1313
<brand-colors />
1414

15-
::: tip
16-
Also check [Theme Builder](/style/theme-builder) for a tool on customizing the brand colors of your website/app.
15+
::: tip TIPS
16+
* Also check [Theme Builder](/style/theme-builder) for a tool on customizing the brand colors of your website/app.
17+
* `dark` was added in Quasar v1.3.0.
1718
:::
1819

1920
## Color List

docs/src/pages/style/dark-mode.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: Dark Mode
33
desc: Handle dark mode with Quasar.
44
badge: v1.3+
5+
related:
6+
- /quasar-plugins/dark
7+
- /style/theme-builder
58
---
69

710
Dark Mode is a supplemental mode that can be used to display mostly dark surfaces on the UI. The design reduces the light emitted by device screens while maintaining the minimum color contrast ratios required for readability.
@@ -24,7 +27,7 @@ You can easily switch between Dark mode and light mode (which is default) throug
2427

2528
## How to style your app
2629

27-
Since your app can be in Dark mode or not, you can easily style it by taking advantage of the `body` tag attached CSS class: `body--light` or `body--dark`. That is if you want to support both modes.
30+
Since your app can be in Dark mode or not, you can easily style it by taking advantage of the `body` tag attached CSS class: `body--light` or `body--dark`. **That is if you want to support both modes.**
2831

2932
```css
3033
.body--light {
@@ -35,3 +38,11 @@ Since your app can be in Dark mode or not, you can easily style it by taking adv
3538
/* ... */
3639
}
3740
```
41+
42+
Should you wish to override the default Dark mode page background color:
43+
44+
```css
45+
body.body--dark {
46+
background: #000
47+
}
48+
```

docs/src/pages/style/theme-builder.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: Theming
33
desc: Theme builder for a Quasar app with which you can play with the brand colors.
44
components:
55
- theming/ThemeBuilder
6+
related:
7+
- /style/dark-mode
68
---
79

810
One of the most important parts of a website/app is to build a brand for it. First step is to choose the brand colors that you are going to use and this is what the tool below helps you with.
@@ -13,6 +15,7 @@ Click on the colored buttons besides the layout below and when you are ready, hi
1315

1416
<theme-builder class="q-py-lg" />
1517

16-
::: tip
17-
Sass/SCSS is only available if you have Quasar v1.1.1+ and your project is managed by Quasar CLI through @quasar/app v1.1.0+.
18+
::: tip TIPS
19+
* Sass/SCSS is only available if you have Quasar v1.1.1+ and your project is managed by Quasar CLI through @quasar/app v1.1.0+.
20+
* `dark` was added in Quasar v1.3.0.
1821
:::

ui/dev/components/form/checkbox.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
Indeterminate
1919
</p>
2020
<q-checkbox v-model="indModel" toggle-indeterminate :dark="dark" :dense="dense" :keep-color="keepColor" label="Tap me to change between 3 states" />
21+
<q-checkbox v-model="indModel" toggle-indeterminate :dark="dark" :dense="dense" :keep-color="keepColor" color="accent" label="Tap me to change between 3 states" />
2122

2223
<p class="caption">
2324
Tests

0 commit comments

Comments
 (0)