Migrate to bulma-css-variables and introduce dark mode #954

Merged
konrad merged 72 commits from adrinux/frontend:bulma-css-variables into main 2021-11-22 21:12:55 +00:00
Contributor

Currently uses CSS prefers-color-scheme: dark and so follows the OS level dark preference. This will need to be made user configurable in the Vikunja UI as discussed in Issue #756

For now this allows for preview, discussion, bug hunting and refinement of dark mode colours.
Two open bugs: https://kolaente.dev/adrinux/frontend/issues

Changes:

  • As discussed in #756 this removes bulma module in favour of bulma-css-variables.
  • Moved the colours in variables.scss to colors.scss
  • Converts colors.css from sass variables to css variables
  • Converts uses of those variables throughout the codebase
  • Renames some Vikunja colour variables to semantic names e.g. '$red' to '--danger'
  • Adds a crude dark mode

Dark mode notes
By 'crude dark mode' I mean

  • That black, white and greys were simply flipped to the 'opposite' value.
  • Not much attempt has been made to make it look nice, just usable.
  • Box shadows were made darker, but are barely visible
  • All other colours including primary have been left the same as light mode because they work just as well IMO.

So feedback please on whether bulma-css-variables is the way forward and if so whether there are any other bugs in dark mode.

Closes #756

Currently uses CSS prefers-color-scheme: dark and so follows the OS level dark preference. This will need to be made user configurable in the Vikunja UI as discussed in Issue #756 For now this allows for preview, discussion, bug hunting and refinement of dark mode colours. Two open bugs: https://kolaente.dev/adrinux/frontend/issues Changes: - As discussed in #756 this removes bulma module in favour of bulma-css-variables. - Moved the colours in variables.scss to colors.scss - Converts colors.css from sass variables to css variables - Converts uses of those variables throughout the codebase - Renames some Vikunja colour variables to semantic names e.g. '$red' to '--danger' - Adds a crude dark mode **Dark mode notes** By 'crude dark mode' I mean - That black, white and greys were simply flipped to the 'opposite' value. - Not much attempt has been made to make it look nice, just usable. - Box shadows were made darker, but are barely visible - All other colours including primary have been left the same as light mode because they work just as well IMO. So feedback please on whether bulma-css-variables is the way forward and if so whether there are any other bugs in dark mode. Closes https://kolaente.dev/vikunja/frontend/issues/756
adrinux added 8 commits 2021-11-04 19:35:47 +00:00
dpschen requested changes 2021-11-04 21:37:24 +00:00
@ -3,10 +3,10 @@
@import "variables";

The @import "colors"; should be removed here and instead added in global.scss below the bulma imports.
Probably also below the theme and components overwrites, but I'm not 100% sure about that.

Reason: the colors.scss produces now CSS output (the :root rules) — it was compiled to nothing before.
Since it's prefixed to every components rendered CSS this would result in a lot of code duplication in the end.
Probably not a big issue with gzip but still unnecessary.

Maybe we should rename it (maybe custom-properties.scss ?) and move it out of this folder (the name variables stood for 'SCSS variables') so that we don't mix contexts, since all the other files inside are imported by this _index.scss.

The `@import "colors";` should be removed here and instead added in `global.scss` below the bulma imports. Probably also below the `theme` and `components` overwrites, but I'm not 100% sure about that. Reason: the `colors.scss` produces now CSS output (the `:root` rules) — it was compiled to nothing before. Since it's prefixed to every components rendered CSS this would result in a lot of code duplication in the end. Probably not a big issue with gzip but still unnecessary. Maybe we should rename it (maybe `custom-properties.scss` ?) and move it out of this folder (the name `variables` stood for 'SCSS variables') so that we don't mix contexts, since all the other files inside are imported by this `_index.scss`.

That's why. No clue as to how to reorder the inline styles though.

#756 (comment)

I just realise that this might fix also the issue you had with !important.

> That's why. No clue as to how to reorder the inline styles though. https://kolaente.dev/vikunja/frontend/issues/756#issuecomment-15640 I just realise that this might fix also the issue you had with `!important`.
Author
Contributor

Yes, there is definitely a lot of duplication and yes I'm sure that's why I had to use !important so much (it seems to be used quite a lot in scss, not just by me!).

Wasn't clear to me if that was introduced by my changes or pre-existing. I have to say I feel like I'd need a couple of hours and to draw a flow chart to figure out the flow of all these imports :) That said it looks like there was already some cleanup recently.

Added an issue so I remember to try this.

Yes, there is definitely a lot of duplication and yes I'm sure that's why I had to use !important so much (it seems to be used quite a lot in scss, not just by me!). Wasn't clear to me if that was introduced by my changes or pre-existing. I have to say I feel like I'd need a couple of hours and to draw a flow chart to figure out the flow of all these imports :) That said it looks like there was already some cleanup recently. Added an [issue](https://kolaente.dev/adrinux/frontend/issues/3#issue-5514) so I remember to try this.
Author
Contributor

That's why. No clue as to how to reorder the inline styles though.

#756 (comment)

I just realise that this might fix also the issue you had with !important.

I've just removed all the '!important' declarations in colors.scss I needed before with no ill effect.

> > That's why. No clue as to how to reorder the inline styles though. > > https://kolaente.dev/vikunja/frontend/issues/756#issuecomment-15640 > > I just realise that this might fix also the issue you had with `!important`. I've just removed all the '!important' declarations in colors.scss I needed before with no ill effect.
konrad marked this conversation as resolved
@ -19,0 +1,4 @@
:root {
/* Vikunja colors as CSS custom properties */
--grey-50: hsl(210, 20%, 98%);

Any specific reason why for the switch to hsl?

Any specific reason why for the switch to hsl?
Author
Contributor

Well:

  • It's the way bulma-css-variables is built. See the source from that line on.
  • hsl is not compatible with the sass colour manipulation mixins but does allow for easy and more understandable specification of variants in itself.
  • It's a superior colour declaration format to hex - though I look forward to lch() being widely supported by browsers ;)
Well: - It's the way bulma-css-variables is built. See the [source](https://github.com/dino4udo/bulma-css-variables/blob/a4c5c4b3730746ae9b0bfb8af754ebfc8ebb88dc/css/bulma.css#L12643) from that line on. - hsl is not compatible with the sass colour manipulation mixins but does allow for easy and more understandable specification of variants in itself. - It's a superior colour declaration format to hex - though I look forward to lch() being widely supported by browsers ;)

It's the way bulma-css-variables is built. See the source from that line on.

That makes sense =)

It's a superior colour declaration format to hex - though I look forward to lch() being widely supported by browsers ;)

LCH is awesome! I always have to force myself to read it corectly because it looks like the German 'me' which is the word 'ich' (at the beginning of a sentence 'Ich' which looks really similar).

> It's the way bulma-css-variables is built. See the source from that line on. That makes sense =) > It's a superior colour declaration format to hex - though I look forward to lch() being widely supported by browsers ;) LCH is awesome! I always have to force myself to read it corectly because it looks like the German 'me' which is the word 'ich' (at the beginning of a sentence 'Ich' which looks really similar).
dpschen marked this conversation as resolved
@ -19,0 +7,4 @@
--grey-300: hsl(216, 12.2%, 83.9%);
--grey-400: hsl(217.9, 10.6%, 64.9%);
--grey-500-hsl: 220, 8.9%, 46.1%;
--grey-500: hsla(var(--grey-500-hsl), 1);

Is hsla needed here? With an opacity of 1 it seems unnecessary

Is hsla needed here? With an opacity of `1` it seems unnecessary
Author
Contributor
  • The --grey-500-hsl is used elsewhere to create opacity variants.
  • You're right we can just reuse --grey-500-hsl here, have changed it 2a65126a80
- The --grey-500-hsl is used elsewhere to create opacity variants. - You're right we can just reuse --grey-500-hsl here, have changed it 2a65126a80c762f5ca00422e4f8981a21ec32e75
adrinux marked this conversation as resolved
@ -19,0 +33,4 @@
--white-l: 100%;
--white-a: 1;
--white: hsla(var(--white-h), var(--white-s), var(--white-l), var(--white-a));
--white-translucent: hsla(var(--white-h), var(--white-s), var(--white-l), 0.75);

🔥

🔥
Author
Contributor

Not clear whether it's the use of variables (we're overriding the ones bulma-css-variables has set) or the fact that vscode seems to have formatted to tabs on paste :(

Fixed it in sublime text but that now formats to tabs on save too :(

I think we need a specific entry for scss files in editorconfig

[*.{scss,css}]
indent_style = space
indent_size = 2

Works for me...but do I include it in this PR?

Not clear whether it's the use of variables (we're overriding the ones bulma-css-variables has set) or the fact that vscode seems to have formatted to tabs on paste :( Fixed it in sublime text but that now formats to tabs on save too :( I think we need a specific entry for scss files in editorconfig ``` [*.{scss,css}] indent_style = space indent_size = 2 ``` Works for me...but do I include it in this PR?

Nahh all good! The 🔥 was in regard to the nice splitting mechanism of the individual color components / channels (not sure what it's called in hsl ?).
That's hot!

Regarding the formatting: we are looking into using prettier either way so I'm ignoring minor formatting stuff right now =)

Nahh all good! The 🔥 was in regard to the nice splitting mechanism of the individual color components / channels (not sure what it's called in hsl ?). That's hot! Regarding the formatting: we are [looking into using prettier](https://kolaente.dev/vikunja/frontend/pulls/930#issue-5468) either way so I'm ignoring minor formatting stuff right now =)

Regarding .editorconfig: maybe create a new separate issue =)

Regarding `.editorconfig`: maybe create a new separate issue =)
Author
Contributor

Regarding .editorconfig: maybe create a new separate issue =)

Work work work ;)

> Regarding `.editorconfig`: maybe create a new separate issue =) Work work work ;)
adrinux marked this conversation as resolved
@ -19,0 +42,4 @@
--black: hsla(var(--black-h), var(--black-s), var(--black-l), var(--black-a));
//$warning/$orange: #ff851b or hsl(27.9, 100%, 55.3%)
--warning-h: 27.9deg !important;

Can you add a comment why the !important is needed?

Can you add a comment why the `!important` is needed?
Author
Contributor

"Because it wont't work without it" doesn't seem very informative :/

As per your earlier comment regarding @import location and order - I think it might be possible to resolve the need for those !important properties and I'd rather try that before commenting.

"Because it wont't work without it" doesn't seem very informative :/ As per your earlier comment regarding @import location and order - I think it might be possible to resolve the need for those !important properties and I'd rather try that before commenting.

Yes I found out about that later =) The calc in the comment below might even be possible without that !important

Yes I found out about that later =) The `calc` in the comment below might even be possible without that `!important`
dpschen marked this conversation as resolved
@ -19,0 +67,4 @@
--primary: hsla(var(--primary-h), var(--primary-s), var(--primary-l), var(--primary-a));
// simulate sass lighten($primary, 30) by increasing lightness 30% to 73%
--primary-light: hsla(var(--primary-h), var(--primary-s), 73%, var(--primary-a));

Is it possible to use calc() here?

Is it possible to use `calc()` here?

Ahh I saw the !important now

Ahh I saw the `!important` now
Author
Contributor

Is it possible to use calc() here?

I did initially but really I think it just obfuscates the actual value, though I don't much like the this either.
So:

calc(var(--primary-l) * 1.3)

Works to give a 30% increase?

--primary-light is only used in src/views/tasks/TaskDetailView.vue and I've no idea what end result it has. Can't see what different values do. Any idea?

If we stick with hard coding a value I wonder if using the pattern bulma-css-variables uses would be clearer:

 --primary-h: 216.5deg !important;
 --primary-s: 100% !important;
 --primary-l: 54.9% !important;
 --primary-light-l: 73%;
 --primary-a: 1 !important;
 --primary: hsla(var(--primary-h), var(--primary-s), var(--primary-l), var(--primary-a));

  // simulate sass lighten($primary, 30) by increasing lightness 30% to 73%
  --primary-light: hsla(var(--primary-h), var(--primary-s), var(--primary-light-l), var(--primary-a));
  --primary-translucent: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.5);

Thoughts? EDIT: have actually just changed it to the latter.

> Is it possible to use `calc()` here? I did initially but really I think it just obfuscates the actual value, though I don't much like the this either. So: ``` calc(var(--primary-l) * 1.3) ``` Works to give a 30% increase? --primary-light is only used in src/views/tasks/TaskDetailView.vue and I've no idea what end result it has. Can't see what different values do. Any idea? If we stick with hard coding a value I wonder if using the pattern bulma-css-variables uses would be clearer: ``` --primary-h: 216.5deg !important; --primary-s: 100% !important; --primary-l: 54.9% !important; --primary-light-l: 73%; --primary-a: 1 !important; --primary: hsla(var(--primary-h), var(--primary-s), var(--primary-l), var(--primary-a)); // simulate sass lighten($primary, 30) by increasing lightness 30% to 73% --primary-light: hsla(var(--primary-h), var(--primary-s), var(--primary-light-l), var(--primary-a)); --primary-translucent: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.5); ``` Thoughts? EDIT: have actually just changed it to the latter.
adrinux marked this conversation as resolved
@ -19,0 +71,4 @@
--primary-translucent: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.5);
}
@media (prefers-color-scheme: dark) {

Nest the @media so we don't need to repeat :root.

Nest the `@media` so we don't need to repeat `:root`.
Author
Contributor

Good catch. Done a258b938fa

Good catch. Done https://kolaente.dev/adrinux/frontend/commit/a258b938fabdb69b30615897b157c37a020b4059
adrinux marked this conversation as resolved
@ -6,0 +7,4 @@
0 3px 6px hsla(var(--grey-500-hsl), .08);
--shadow-lg: 0 15px 25px hsla(var(--grey-500-hsl), .12),
0 5px 10px hsla(var(--grey-500-hsl), .05);
// unused --shadow-xl: 0 20px 40px hsla(var(--grey-500-hsl), .2);

good catch!
I think we should either remove it or uncomment it. Like this doesn't make sense (?).

good catch! I think we should either remove it or uncomment it. Like this doesn't make sense (?).
Author
Contributor

The comment was to spark exactly this conversation :)
Should I remove it?

It's not used. It's not overriding something declared by bulma.

I vote for remove...

The comment was to spark exactly this conversation :) Should I remove it? It's not used. It's not overriding something declared by bulma. I vote for remove...

@konrad: do you remember the reason for shadow?

@konrad: do you remember the reason for shadow?

No real reason. When I added the shadows, I added a few variants to have a bit more flexibility. If it's not used anywhere I think it is fine to remove.

No real reason. When I added the shadows, I added a few variants to have a bit more flexibility. If it's not used anywhere I think it is fine to remove.
Author
Contributor

Removed shadow-xl 92b2010cdc

Removed shadow-xl https://kolaente.dev/adrinux/frontend/commit/92b2010cdc7912142105a401056ec200dd6356eb
adrinux marked this conversation as resolved
@ -6,0 +11,4 @@
}
@media (prefers-color-scheme: dark) {
:root {

Nest the @media so we don't need to repeat :root. (2)

Nest the `@media` so we don't need to repeat `:root`. (2)
Author
Contributor

Done a258b938fa

Done https://kolaente.dev/adrinux/frontend/commit/a258b938fabdb69b30615897b157c37a020b4059
adrinux marked this conversation as resolved
@ -7,3 +1,2 @@
$primary: $blue;
$info-invert: $white;
$info-invert: #fff;

Might make sense to add a comment here why this is still defined as hex

Might make sense to add a comment here _why_ this is still defined as hex
Author
Contributor

Doesn't appear to be used in vikunja code and is a duplicate of the var declared by bulma-css-variables so I removed it instead aff7a1f2ea

Doesn't appear to be used in vikunja code and is a duplicate of the var declared by bulma-css-variables so I removed it instead https://kolaente.dev/adrinux/frontend/commit/aff7a1f2eadc75b690856ff2b2603a4897588209
adrinux marked this conversation as resolved
@ -637,3 +637,3 @@
.bucket {
background-color: $bucket-background;
background-color: var(--bucket-background);

This seems like a mistake: $bucket-background is still defined as SASS variable.
I think it makes sense to keep it that way: Compiled it will resolve in var(--grey-100) which seems fine

This seems like a mistake: `$bucket-background` is still defined as SASS variable. I think it makes sense to keep it that way: Compiled it will resolve in `var(--grey-100)` which seems fine
Author
Contributor

Yep, reverted 0191f12db7

Though declaring it to be the same color as what's behind it seems pointless - hangover from previous kanban design?

Yep, reverted https://kolaente.dev/adrinux/frontend/commit/0191f12db76bf93bee91ea0e58dd7d52c2f423e4 Though declaring it to be the same color as what's behind it seems pointless - hangover from previous kanban design?

@konrad: any idea?

@konrad: any idea?

It kind of comes from the kanban redesign, but is still required: When the list has a background, the buckets need to have a colored background.

It kind of comes from the kanban redesign, but is still required: When the list has a background, the buckets need to have a colored background.

I think we could remove the variable and swap its uses to use the same variable that's used for the overall site background.

I think we could remove the variable and swap its uses to use the same variable that's used for the overall site background.

You mean the variable that was set for $bucket-background aka var(--grey-100)?

You mean the variable that was set for `$bucket-background` aka `var(--grey-100)`?
Author
Contributor

Removed $bucket-background 54f1271ab9

Removed $bucket-background https://kolaente.dev/adrinux/frontend/commit/54f1271ab935a5b0c93168378395c4093ac4f01b
adrinux marked this conversation as resolved
@ -686,3 +686,3 @@
.button {
background: $bucket-background;
background: var(--bucket-background);

Same here

Same here
Author
Contributor

Reverted.

Reverted.
adrinux marked this conversation as resolved
adrinux added 1 commit 2021-11-05 11:38:51 +00:00
continuous-integration/drone/pr Build is passing Details
2a65126a80
No need to use opacity of 1
adrinux added 1 commit 2021-11-05 12:56:48 +00:00
adrinux added 1 commit 2021-11-05 13:04:04 +00:00
continuous-integration/drone/pr Build is passing Details
aff7a1f2ea
Removed unused sass variable -invert
adrinux added 1 commit 2021-11-05 13:30:58 +00:00
adrinux added 1 commit 2021-11-05 14:04:18 +00:00
continuous-integration/drone/pr Build is passing Details
b39a699d58
Change dark mode white to a grey looks better
adrinux added 1 commit 2021-11-05 22:17:12 +00:00
continuous-integration/drone/pr Build is passing Details
1c90178e5e
Fix #2 - modal close button not visible
adrinux added 1 commit 2021-11-05 23:34:53 +00:00
continuous-integration/drone/pr Build is passing Details
f5f00bf46e
Remove important declarations that are no longer needed
konrad reviewed 2021-11-07 14:10:17 +00:00
@ -7,3 +7,3 @@
:focus {
box-shadow: 0 0 0 2px rgba($primary, 0.5);
box-shadow: 0 0 0 2px var(--primary-translucent);

Doesn't rgba(var(--primary), 0.5) work?

Doesn't `rgba(var(--primary), 0.5)` work?

No, since the var already includes hsla() so resolved by the browser it would be double wrapped:

rgba(hsla(var(--primary-h), var(--primary-s), var(--primary-l), var(--primary-a)), 0.5)

See: https://kolaente.dev/vikunja/frontend/pulls/954/files#issuecomment-18553

rgba() also just accepts r, g, b, a values. SASS would render this as as the css rgba() and not the SCSS rgba() helper since it includes a custom-property which can not be resolved by SASS at build time.

No, since the var already includes `hsla()` so resolved by the browser it would be double wrapped: ```css rgba(hsla(var(--primary-h), var(--primary-s), var(--primary-l), var(--primary-a)), 0.5) ``` See: https://kolaente.dev/vikunja/frontend/pulls/954/files#issuecomment-18553 `rgba()` also just accepts r, g, b, a values. SASS would render this as as the css [rgba()](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgba()) and not the SCSS [`rgba()` helper](https://sass-lang.com/documentation/modules#rgb) since it includes a custom-property which can not be resolved by SASS at build time.
Author
Contributor

Given that --primary-translucent is only used twice (both in theme.scss, lines 8 & 18), it might make more sense to use the existing primary-* vars to build those 2 instances.

box-shadow: 0 0 0 2px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.5;

or do what I've done with some of the greys and define a 'naked' --primary-hsl that we can drop in:

box-shadow: 0 0 0 2px hsla(var(--primary-hsl), 0.5;

I think the latter is most readable, and doesn't make the alpha value hard to see.

Thoughts @konrad @dpschen ?

Given that --primary-translucent is only used twice (both in theme.scss, lines 8 & 18), it might make more sense to use the existing primary-* vars to build those 2 instances. ``` box-shadow: 0 0 0 2px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.5; ``` or do what I've done with some of the greys and define a 'naked' --primary-hsl that we can drop in: ``` box-shadow: 0 0 0 2px hsla(var(--primary-hsl), 0.5; ``` I think the latter is most readable, and doesn't make the alpha value hard to see. Thoughts @konrad @dpschen ?

I think the second one makes most sense.

I think the second one makes most sense.

I just realize that we have to define that --primary-hsl just for that usecase. Then we could also just keep with the --primary-translucent.

Because of that I would prefer the first solution. 🤷‍♂️

I just realize that we have to define that `--primary-hsl` just for that usecase. Then we could also just keep with the `--primary-translucent`. Because of that I would prefer the first solution. 🤷‍♂️
Author
Contributor

I created --primary-hsl as described above 6c59567ebf

I created --primary-hsl as described above https://kolaente.dev/adrinux/frontend/commit/6c59567ebf1bd1e706554ec33326c886706fb45a
adrinux marked this conversation as resolved
@ -19,0 +6,4 @@
--grey-200: hsl(220, 13%, 91%);
--grey-300: hsl(216, 12.2%, 83.9%);
--grey-400: hsl(217.9, 10.6%, 64.9%);
--grey-500-hsl: 220, 8.9%, 46.1%;

Why is there grey-500 and grey-500-hsl? If they are the same, why are there two of them?

Why is there `grey-500` and `grey-500-hsl`? If they are the same, why are there two of them?

As far as I understand grey-500 is directly usable inside a css color property.
E.g:

background-color: var(--grey-500);

While grey-500-hsl are just the pure hsl values with the intend to use them in different contexts. E.g.:

background-color: hsla(var(--grey-500-hsl, 0.4);
As far as I understand `grey-500` is directly usable inside a css color property. E.g: ```css background-color: var(--grey-500); ``` While `grey-500-hsl` are just the pure hsl values with the intend to use them in different contexts. E.g.: ```css background-color: hsla(var(--grey-500-hsl, 0.4); ```

Makes sense. Then maybe there should be variables like these for all color variants? To make it consistent?

Makes sense. Then maybe there should be variables like these for all color variants? To make it consistent?

Yes, that's true. Especially since bulma-scss-variables does the same for all predefined ones.

Yes, that's true. Especially since bulma-scss-variables does the same for all predefined ones.
Author
Contributor

Yes, @dpschen is right, I picked up that approach from bulma-css-variables and it's for adding the alpha where needed.

@konrad the reason I only added them for a couple of greys is because those are the only greys where an alpha variant is actually used. I get the desire for uniformity and consistency, but is it worth declaring unused variables?

(Technically I should remove the dark mode --grey-300-hsl because that's not currently used in the PR either, was the result of some experimenting.)

Yes, @dpschen is right, I picked up that approach from bulma-css-variables and it's for adding the alpha where needed. @konrad the reason I only added them for a couple of greys is because those are the only greys where an alpha variant is actually used. I get the desire for uniformity and consistency, but is it worth declaring unused variables? (Technically I should remove the dark mode --grey-300-hsl because that's not currently used in the PR either, was the result of some experimenting.)

I get the desire for uniformity and consistency, but is it worth declaring unused variables?

It probably is not. Let's say as long as there's only a few variants where a -hsl variant makes sense there's no need to add one for each color. As long as maybe more than half of the variants are used as-is (without a -hsl variant) I'm fine with adding them on a case-by-case basis when they are needed.

> I get the desire for uniformity and consistency, but is it worth declaring unused variables? It probably is not. Let's say as long as there's only a few variants where a `-hsl` variant makes sense there's no need to add one for each color. As long as maybe more than half of the variants are used as-is (without a `-hsl` variant) I'm fine with adding them on a case-by-case basis when they are needed.
adrinux marked this conversation as resolved
@ -19,0 +13,4 @@
--grey-800: hsl(215, 27.9%, 16.9%);
--grey-900: hsl(220.9, 39.3%, 11%);
--light-background: var(--grey-100);

We should call this just --background-color or --site-background-color.

We should call this just `--background-color` or `--site-background-color`.
Author
Contributor

I've renamed the --light-background variable to --site-background in a45c6cdf6b

I've renamed the --light-background variable to --site-background in https://kolaente.dev/adrinux/frontend/commit/a45c6cdf6bb001b1a2ff18547f7c3d72eb6f9d8f
konrad marked this conversation as resolved
@ -19,0 +33,4 @@
--white-l: 100%;
--white-a: 1;
--white: hsla(var(--white-h), var(--white-s), var(--white-l), var(--white-a));
--white-translucent: hsla(var(--white-h), var(--white-s), var(--white-l), 0.75);

--white-translucent has a different opacity than --primary-translucent. I think it should either be the same kind of translucent or there should be variants of it like --white-opacity-75 or similar. On the other hand, since we already defined the hsl parts for it we could probably just use those in combination with a different opacity value directly where it's required.

Then the other thing is that a variable name like white implies that it contains some kind of white. In a dark color scheme that would probably contain something else entirely so white wouldn't actually contain white. Maybe it's a better idea to use a variable name that reflects what this is used for?

The same applies to the greys but I don't really have a good idea for those. I noticed that you did this already for red/green/orange, I think that's the way to go.

`--white-translucent` has a different opacity than `--primary-translucent`. I think it should either be the same kind of translucent or there should be variants of it like `--white-opacity-75` or similar. On the other hand, since we already defined the hsl parts for it we could probably just use those in combination with a different opacity value directly where it's required. Then the other thing is that a variable name like `white` implies that it contains some kind of white. In a dark color scheme that would probably contain something else entirely so `white` wouldn't actually contain white. Maybe it's a better idea to use a variable name that reflects what this is used for? The same applies to the greys but I don't really have a good idea for those. I noticed that you did this already for red/green/orange, I think that's the way to go.
Author
Contributor

On the other hand, since we already defined the hsl parts for it we could probably just use those in combination with a different opacity value directly where it's required.

That makes most sense to me. There are very few instances of translucent colours at present.

Then the other thing is that a variable name like white implies that it contains some kind of white. In a dark color scheme that would probably contain something else entirely so white wouldn't actually contain white. Maybe it's a better idea to use a variable name that reflects what this is used for?

Unfortunely we inherit those from bulma/bulma-css-variables, so I think we're stuck with them for now. I know it seems odd, but you get used to it.

The same applies to the greys but I don't really have a good idea for those.

I think you already have the solution just think of --grey-100 as 10% dark in light mode and 10% light in dark mode.

I noticed that you did this already for red/green/orange, I think that's the way to go.

An easy change because bulma/bulma-css-variables already defines those danger/success/warning variables. Bulma Colors docs.

> On the other hand, since we already defined the hsl parts for it we could probably just use those in combination with a different opacity value directly where it's required. That makes most sense to me. There are very few instances of translucent colours at present. > Then the other thing is that a variable name like `white` implies that it contains some kind of white. In a dark color scheme that would probably contain something else entirely so `white` wouldn't actually contain white. Maybe it's a better idea to use a variable name that reflects what this is used for? Unfortunely we inherit those from bulma/bulma-css-variables, so I think we're stuck with them for now. I know it seems odd, but you get used to it. > The same applies to the greys but I don't really have a good idea for those. I think you already have the solution just think of --grey-100 as 10% dark in light mode and 10% light in dark mode. > I noticed that you did this already for red/green/orange, I think that's the way to go. An easy change because bulma/bulma-css-variables already defines those danger/success/warning variables. [Bulma Colors docs](https://bulma.io/documentation/overview/colors/).
dpschen marked this conversation as resolved
@ -19,0 +71,4 @@
--primary-light: hsla(var(--primary-h), var(--primary-s), var(--primary-light-l), var(--primary-a));
--primary-translucent: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.5);
@media (prefers-color-scheme: dark) {

Maybe it would make sense to group all dark scheme adjustments (and the base light versio) in separate stylesheets instead of seperating by color or shadows?

Maybe it would make sense to group all dark scheme adjustments (and the base light versio) in separate stylesheets instead of seperating by color or shadows?

I think this is fine. Because we might need adjustments deep in components for dark mode either way.
I think it would be wrong to separate those styles from the components.

I think this is fine. Because we might need adjustments deep in components for dark mode either way. I think it would be wrong to separate those styles from the components.

That's something I didn't think about. Makes sense.

That's something I didn't think about. Makes sense.
konrad marked this conversation as resolved
Owner

I think this already looks quite good! Nice job :)

Here's a few things I noticed about the dark mode:

  1. The placeholder needs a color adjustment:

image

  1. I think the list switching button text would work better if it had a light color:

image

  1. The editor needs different colors:

image

  1. Quick Actions as well:

image

  1. Hovering over tertary buttons and dropdowns:

image

image

  1. The modals probably work better with a darker border color (probably needs a different variable):

image

  1. Multiselects should look the same as normal inputs:

image

I think none of these are blocking for this PR, just to note them. I'd be fine to merge this without these things and follow-up with another PR to fix them.

I think this already looks quite good! Nice job :) Here's a few things I noticed about the dark mode: 1. The placeholder needs a color adjustment: ![image](/attachments/2a8b0751-4c4a-4628-b7db-76256b0d0770) 2. I think the list switching button text would work better if it had a light color: ![image](/attachments/dd8d4fec-f6e0-44f0-a718-c67eef0bbbe5) 3. The editor needs different colors: ![image](/attachments/51ede767-a142-4bc8-8d03-4021f15fda74) 4. Quick Actions as well: ![image](/attachments/2cba85b6-2403-4cac-8a32-f5294c5a16f3) 5. Hovering over tertary buttons and dropdowns: ![image](/attachments/d3c6a335-3411-41c6-a3a3-e635351fdf94) ![image](/attachments/210f2cba-3a67-4d2a-be7b-f4c4a987fc8d) 6. The modals probably work better with a darker border color (probably needs a different variable): ![image](/attachments/0fcf59e9-3172-47f3-9b0a-990c8bb80cfc) 7. Multiselects should look the same as normal inputs: ![image](/attachments/a5fdbeab-e428-4798-88ab-fdc39f971284) I think none of these are blocking for this PR, just to note them. I'd be fine to merge this without these things and follow-up with another PR to fix them.
Member

@konrad: Some of these issues might be solved by:
adrinux/frontend#3

@konrad: Some of these issues might be solved by: https://kolaente.dev/adrinux/frontend/issues/3
adrinux added 1 commit 2021-11-08 13:49:23 +00:00
continuous-integration/drone/pr Build is passing Details
6877ca30a1
Move dark color for modal close icon into scoped styles
adrinux added 1 commit 2021-11-08 15:03:22 +00:00
adrinux added 1 commit 2021-11-08 15:26:16 +00:00
Author
Contributor

Here's a few things I noticed about the dark mode:

@konrad This is exactly the sort of extra eyes feedback I was hoping for here :)

With one exception:

  1. The editor needs different colors:

I mean't to add a point in the initial PR description above about the editor but forgot.

I specifically avoided tinkering with the editor because it's a major component in itself:

  • it's a third party component
  • there is an issue to replace it #781
  • I don't feel it's necessary to swap all white area's with grey or black in dark mode.

It would be nice to tackle the editor toolbar, but I'd rather do that seperately in a later PR.

> Here's a few things I noticed about the dark mode: @konrad This is exactly the sort of extra eyes feedback I was hoping for here :) With one exception: > 3. The editor needs different colors: I mean't to add a point in the initial PR description above about the editor but forgot. I specifically avoided tinkering with the editor because it's a major component in itself: - it's a third party component - there is an issue to replace it #781 - I don't feel it's necessary to swap all white area's with grey or black in dark mode. It would be nice to tackle the editor toolbar, but I'd rather do that seperately in a later PR.
adrinux added 1 commit 2021-11-08 20:53:12 +00:00
continuous-integration/drone/pr Build is passing Details
a45c6cdf6b
Rename light-background variable to site-background
adrinux added 1 commit 2021-11-08 21:46:35 +00:00
continuous-integration/drone/pr Build is passing Details
0e93ddf4b5
Move colors.scss include into global.scss
adrinux added 1 commit 2021-11-08 21:52:10 +00:00
Owner

It would be nice to tackle the editor toolbar, but I'd rather do that seperately in a later PR.

Sure, sounds like a good idea 🙂

> It would be nice to tackle the editor toolbar, but I'd rather do that seperately in a later PR. Sure, sounds like a good idea 🙂
adrinux added 1 commit 2021-11-10 14:45:53 +00:00
adrinux added 2 commits 2021-11-10 15:07:32 +00:00
adrinux added 1 commit 2021-11-11 10:02:31 +00:00
Member

Hi adrinux!

Thank you for creating a PR!

I've deployed the changes of this PR on a preview environment under this URL: https://954-bulma-css-variables--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.

Have a nice day!

Beep boop, I'm a bot.

Hi adrinux! Thank you for creating a PR! I've deployed the changes of this PR on a preview environment under this URL: https://954-bulma-css-variables--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/. Have a nice day! > Beep boop, I'm a bot.
adrinux added 2 commits 2021-11-11 10:49:40 +00:00
adrinux added 1 commit 2021-11-11 13:38:21 +00:00
adrinux added 1 commit 2021-11-11 15:42:07 +00:00
Author
Contributor

Current status of these:

  1. The placeholder needs a color adjustment:

Done.

  1. I think the list switching button text would work better if it had a light color:

Done.

  1. The editor needs different colors:

Mutual agreement to postpone.

  1. Quick Actions as well:

Looked into this - Chrome (the beta at least) is overriding the button colors with it's own internal stylesheet, so even the current light mode button color only applies to firefox. Possibly something to do with :autofill css pseudo class, haven't got to the bottom of this yet.

Quite a lot to fix in this pop-up.
Still Todo.

  1. Hovering over tertary buttons and dropdowns:

The specific 'Delete' button in the image should probably be fixed by adding class .is-danger?

Still Todo.

  1. The modals probably work better with a darker border color (probably needs a different variable):

Done. A much more subtle border now.

  1. Multiselects should look the same as normal inputs:

If you look carefully they're actually slightly heavier looking in light mode too - so something else likely needs addressed rather than a dark mode override.

Still Todo. Need to look deeper at this.

I think none of these are blocking for this PR, just to note them. I'd be fine to merge this without these things and follow-up with another PR to fix them.

I think we need the logo text to be the right color and that depends on #971 at the moment.

And the remaining big issue is adding UI to switch dark mode on or off permanently - that will also require removing the prefers-dark media query currently in this PR and replacing it with a .dark-mode class.

Current status of these: > 1. The placeholder needs a color adjustment: Done. > 2. I think the list switching button text would work better if it had a light color: Done. > 3. The editor needs different colors: Mutual agreement to postpone. > 4. Quick Actions as well: Looked into this - Chrome (the beta at least) is overriding the button colors with it's own internal stylesheet, so even the current light mode button color only applies to firefox. Possibly something to do with :autofill css pseudo class, haven't got to the bottom of this yet. Quite a lot to fix in this pop-up. Still Todo. > 5. Hovering over tertary buttons and dropdowns: The specific 'Delete' button in the image should probably be fixed by adding class .is-danger? Still Todo. > 6. The modals probably work better with a darker border color (probably needs a different variable): Done. A much more subtle border now. > 7. Multiselects should look the same as normal inputs: If you look carefully they're actually slightly heavier looking in light mode too - so something else likely needs addressed rather than a dark mode override. Still Todo. Need to look deeper at this. > I think none of these are blocking for this PR, just to note them. I'd be fine to merge this without these things and follow-up with another PR to fix them. I think we need the logo text to be the right color and that depends on #971 at the moment. And the remaining big issue is adding UI to switch dark mode on or off permanently - that will also require removing the prefers-dark media query currently in this PR and replacing it with a .dark-mode class.
Member

I created another branch that adds the color scheme settings:

I created another branch that adds the color scheme settings: - https://kolaente.dev/dpschen/frontend/src/branch/feature/add-color-scheme-setting (branch) - https://kolaente.dev/dpschen/frontend/commit/817845a70bbcbf82ed744ba4585a6d7a176abd2a (commit)
adrinux added 2 commits 2021-11-12 15:37:52 +00:00
Author
Contributor

I created another branch that adds the color scheme settings:

Wow, you really are on 🔥 Dominik!

Works really well!

Have merged @dpschen color scheme switch into my dark mode branch.

> I created another branch that adds the color scheme settings: Wow, you really are on 🔥 Dominik! Works really well! Have merged @dpschen color scheme switch into my dark mode branch.
konrad added 2 commits 2021-11-13 13:52:14 +00:00
continuous-integration/drone/pr Build is passing Details
749749db9a
chore: yarn install after merge with main
Owner

Looked into this - Chrome (the beta at least) is overriding the button colors with it's own internal stylesheet, so even the current light mode button color only applies to firefox. Possibly something to do with :autofill css pseudo class, haven't got to the bottom of this yet.

Does it work if we'd define the text color with the :placeholder pseudo class globally for everything?

The specific 'Delete' button in the image should probably be fixed by adding class .is-danger?

Yup.

> Looked into this - Chrome (the beta at least) is overriding the button colors with it's own internal stylesheet, so even the current light mode button color only applies to firefox. Possibly something to do with :autofill css pseudo class, haven't got to the bottom of this yet. Does it work if we'd define the text color with the `:placeholder` pseudo class globally for everything? > The specific 'Delete' button in the image should probably be fixed by adding class .is-danger? Yup.
konrad added 2 commits 2021-11-13 14:27:07 +00:00
87064f1578
Merge branch 'main' into bulma-css-variables
# Conflicts:
#	src/components/home/contentLinkShare.vue
#	src/components/home/contentNoAuth.vue
#	src/styles/theme/navigation.scss
continuous-integration/drone/pr Build is failing Details
1745c174e1
chore: yarn install after merge with main
konrad added 2 commits 2021-11-13 20:39:24 +00:00
2614fddf51
Merge branch 'main' into bulma-css-variables
# Conflicts:
#	src/App.vue
#	src/components/home/contentNoAuth.vue
#	src/components/home/topNavigation.vue
#	src/components/misc/api-config.vue
#	src/components/tasks/partials/relatedTasks.vue
adrinux added 2 commits 2021-11-13 21:12:54 +00:00
adrinux added 1 commit 2021-11-13 21:32:19 +00:00
continuous-integration/drone/pr Build is passing Details
f08a68594e
Move merged sass vars to css vars
adrinux added 1 commit 2021-11-13 21:45:59 +00:00
continuous-integration/drone/pr Build is passing Details
faa3c3b156
Set logo text to currentColor
adrinux added 1 commit 2021-11-13 22:37:57 +00:00
continuous-integration/drone/pr Build is passing Details
a957df0a59
Set logo text color in light and dark mode
adrinux added 1 commit 2021-11-13 22:54:27 +00:00
continuous-integration/drone/pr Build is failing Details
f11eeb6dce
Fix embeded logo inheriting bulma navbar hover styles
konrad reviewed 2021-11-13 22:58:04 +00:00
@ -2,3 +2,3 @@
<div class="no-auth-wrapper">
<div class="noauth-container">
<Logo width="400" height="117" />
<Logo class="logo" width="400" height="117" />

Maybe setting the logo text color should be done in the Logo component directly?

Maybe setting the logo text color should be done in the `Logo` component directly?
Author
Contributor

I assumed so and added scoped scss in there but it had no effect - possibly my lack of vue experience - is it neccessary to tell vue it has to render scss in logo.vue?

That said this is only on the log on page. Once logged in the logo class is on the link wrapping the logo and svg inherits color set on that...

I assumed so and added scoped scss in there but it had no effect - possibly my lack of vue experience - is it neccessary to tell vue it has to render scss in logo.vue? That said this is only on the log on page. Once logged in the logo class is on the link wrapping the logo and svg inherits color set on that...

I assumed so and added scoped scss in there but it had no effect - possibly my lack of vue experience - is it neccessary to tell vue it has to render scss in logo.vue?

Did you tell it the content in the style tag was in scss with the lang="scss" attribute?

> I assumed so and added scoped scss in there but it had no effect - possibly my lack of vue experience - is it neccessary to tell vue it has to render scss in logo.vue? Did you tell it the content in the style tag was in scss with the `lang="scss"` attribute?

This should definately happen inside the Logo component, else we'll have to repeat the styles all over.

This should definately happen inside the Logo component, else we'll have to repeat the styles all over.
Author
Contributor

Yes I added lang="scss". It was late on a Saturday night so maybe I missed something but I literally copied the entire style tag from another vue file, and added the logo class to the template section.

<template>
	<Logo class="logo" alt="Vikunja" />
</template>

// and

<style lang="scss" scoped>
  .logo {
    color: var(--logo-text-color);
  }
</style>

I even killed and restarted yarn serve. So why didn't it work? Traditional css would say I need a more specific selector, but this is scoped so 🤷

Yes it should happen inside the logo component. And there are a pile of pre-existing logo styles that need moved there that are currently in other files.

Yes I added lang="scss". It *was* late on a Saturday night so maybe I missed something but I literally copied the entire style tag from another vue file, and added the logo class to the template section. ``` <template> <Logo class="logo" alt="Vikunja" /> </template> // and <style lang="scss" scoped> .logo { color: var(--logo-text-color); } </style> ``` I even killed and restarted yarn serve. So why didn't it work? Traditional css would say I need a more specific selector, but this is scoped so 🤷 Yes it *should* happen inside the logo component. And there are a pile of pre-existing logo styles that need moved there that are currently in other files.

Yes I added lang="scss". It was late on a Saturday night so maybe I missed something but I literally copied the entire style tag from another vue file, and added the logo class to the template section.

<template>
	<Logo class="logo" alt="Vikunja" />
</template>

// and

<style lang="scss" scoped>
  .logo {
    color: var(--logo-text-color);
  }
</style>

I even killed and restarted yarn serve. So why didn't it work? Traditional css would say I need a more specific selector, but this is scoped so 🤷

Yes it should happen inside the logo component. And there are a pile of pre-existing logo styles that need moved there that are currently in other files.

When you check the dom: Does with that style the class logo apply to the SVG?
Because if there is a class that defines the --logo-text-color I don't see a reason why scoping should change anything (since currentColor inherits)?

Other then that: there is also the :deep() selector that helps styling deep children (basically stuff that is inside child components). But I don't think it should be necessary.

> Yes I added lang="scss". It *was* late on a Saturday night so maybe I missed something but I literally copied the entire style tag from another vue file, and added the logo class to the template section. > > ``` > <template> > <Logo class="logo" alt="Vikunja" /> > </template> > > // and > > <style lang="scss" scoped> > .logo { > color: var(--logo-text-color); > } > </style> > ``` > > I even killed and restarted yarn serve. So why didn't it work? Traditional css would say I need a more specific selector, but this is scoped so 🤷 > > > Yes it *should* happen inside the logo component. And there are a pile of pre-existing logo styles that need moved there that are currently in other files. > > When you check the dom: Does with that style the class `logo` apply to the SVG? Because if there is a class that defines the `--logo-text-color` I don't see a reason why scoping should change anything (since currentColor inherits)? Other then that: there is also the `:deep()` selector that helps styling deep children (basically stuff that is inside child components). But I don't think it should be necessary.

Solved in 4133363fe1

Solved in https://kolaente.dev/vikunja/frontend/commit/4133363fe10cd724862007e57a82339928cd4362
dpschen marked this conversation as resolved
adrinux changed title from WIP: Migrate to bulma-css-variables and introduce dark mode to Migrate to bulma-css-variables and introduce dark mode 2021-11-13 23:02:31 +00:00
Author
Contributor

Removed WIP after fixing the logo text colour.

@konrad Points 4,5 & 7 in #954 (comment) still need work but can get their own issues as suggested.

Removed WIP after fixing the logo text colour. @konrad Points 4,5 & 7 in https://kolaente.dev/vikunja/frontend/pulls/954#issuecomment-18550 still need work but can get their own issues as suggested.
adrinux added 1 commit 2021-11-13 23:06:49 +00:00
adrinux added 1 commit 2021-11-13 23:24:40 +00:00
continuous-integration/drone/pr Build is passing Details
3bd3165032
Fix tag color in dark mode
adrinux added 1 commit 2021-11-14 00:22:23 +00:00
Author
Contributor

Looked into this - Chrome (the beta at least) is overriding the button colors with it's own internal stylesheet, so even the current light mode button color only applies to firefox. Possibly something to do with :autofill css pseudo class, haven't got to the bottom of this yet.

Does it work if we'd define the text color with the :placeholder pseudo class globally for everything?

Scratch that, it seems no specific color was set for the results button text, presumably that's why Chrome was falling back to internal styles. Fixed now.

The specific 'Delete' button in the image should probably be fixed by adding class .is-danger?

Yup.

Yeah...I haven't figured out how yet =D
Feel like I'm missing some broswer tools for vue that would tell me which template needs edited.

> > Looked into this - Chrome (the beta at least) is overriding the button colors with it's own internal stylesheet, so even the current light mode button color only applies to firefox. Possibly something to do with :autofill css pseudo class, haven't got to the bottom of this yet. > > Does it work if we'd define the text color with the `:placeholder` pseudo class globally for everything? Scratch that, it seems no specific color was set for the results button text, presumably that's why Chrome was falling back to internal styles. Fixed now. > > The specific 'Delete' button in the image should probably be fixed by adding class .is-danger? > > Yup. Yeah...I haven't figured out how yet =D Feel like I'm missing some broswer tools for vue that would tell me which template needs edited.
Author
Contributor

Removed WIP after fixing the logo text colour.

@konrad Points 4,5 & 7 in #954 (comment) still need work but can get their own issues as suggested.

Down to 5 & 7 now.

Down to point 5.

> Removed WIP after fixing the logo text colour. > > @konrad Points 4,5 & 7 in https://kolaente.dev/vikunja/frontend/pulls/954#issuecomment-18550 still need work but can get their own issues as suggested. ~~Down to 5 & 7 now.~~ Down to point 5.
adrinux added 1 commit 2021-11-14 00:36:17 +00:00
Owner

Yeah...I haven't figured out how yet =D
Feel like I'm missing some broswer tools for vue that would tell me which template needs edited.

The button-related stuff should be fixed in the button component for the "tertary" style, that's located at src/components/input/button.vue.

The vue devtools extension can tell you what components are used where.

Down to point 5.

So that's all that's missing?

> Yeah...I haven't figured out how yet =D Feel like I'm missing some broswer tools for vue that would tell me which template needs edited. The button-related stuff should be fixed in the button component for the "tertary" style, that's located at `src/components/input/button.vue`. The [vue devtools](https://chrome.google.com/webstore/detail/vuejs-devtools/ljjemllljcmogpfapbkkighbhhppjdbg) extension can tell you what components are used where. > Down to point 5. So that's all that's missing?
Author
Contributor

The vue devtools extension can tell you what components are used where.

Turns out I had the non-beta version installed but it wasn't working :)
Installed the beta version.

Down to point 5.

So that's all that's missing?

There may yet be other broken parts tucked away in there somewhere. That's the last that I'm aware of.

I think there other non-broken but not perfect bits that need some action, but those veer into taste and design decisions. Like the too dark (to my eyes) hover state on buttons.

Then there pre-existing things like the active state of input border colour being --link instead of --primary, something I'd never noticed as a user but is way more obvious in dark mode.

Should those design changes belong in this PR?

> The [vue devtools](https://chrome.google.com/webstore/detail/vuejs-devtools/ljjemllljcmogpfapbkkighbhhppjdbg) extension can tell you what components are used where. Turns out I had the non-beta version installed but it wasn't working :) Installed the beta version. > > Down to point 5. > > So that's all that's missing? There may yet be other broken parts tucked away in there somewhere. That's the last that I'm aware of. I think there other non-broken but not perfect bits that need some action, but those veer into taste and design decisions. Like the too dark (to my eyes) hover state on buttons. Then there pre-existing things like the active state of input border colour being --link instead of --primary, something I'd never noticed as a user but is way more obvious in dark mode. Should those design changes belong in this PR?
Owner

Turns out I had the non-beta version installed but it wasn't working :)
Installed the beta version.

Yeah the stable version has issues with Vue 3.

Then there pre-existing things like the active state of input border colour being --link instead of --primary, something I'd never noticed as a user but is way more obvious in dark mode.

Maybe we should just set --link to --primary once and for all?

Should those design changes belong in this PR?

I'd say if those are things that are required to fix for dark mode to work, then yes. I think this PR is quite big already, might as well do follow-up PRs for everything not related to the switch to bulma-css-vars and adding a basic dark color scheme that "looks fine".

> Turns out I had the non-beta version installed but it wasn't working :) Installed the beta version. Yeah the stable version has issues with Vue 3. > Then there pre-existing things like the active state of input border colour being --link instead of --primary, something I'd never noticed as a user but is way more obvious in dark mode. Maybe we should just set `--link` to `--primary` once and for all? > Should those design changes belong in this PR? I'd say if those are things that are required to fix for dark mode to work, then yes. I think this PR is quite big already, might as well do follow-up PRs for everything not related to the switch to bulma-css-vars and adding a basic dark color scheme that "looks fine".
Member

I'd say if those are things that are required to fix for dark mode to work, then yes. I think this PR is quite big already, might as well do follow-up PRs for everything not related to the switch to bulma-css-vars and adding a basic dark color scheme that "looks fine".

I'm not so happy with the component specific var definitions in colors.scss e.g.
--card-border-color. But I also don't have a good solution for these right now.

The main issue that I have is that the scoped styles prevent us from accessing the global .dark class that is active on the html element in dark mode (Because .dark either points to a scoped .dark class or the nested classes will not be scoped when using :globa()).

I have an idea, but that needs a change in vues sfc-compiler. I'm currently preparing an issue for this.

For now let's keep the styles as they are, just wanted to have that mentioned.

> I'd say if those are things that are required to fix for dark mode to work, then yes. I think this PR is quite big already, might as well do follow-up PRs for everything not related to the switch to bulma-css-vars and adding a basic dark color scheme that "looks fine". I'm not so happy with the component specific var definitions in `colors.scss` e.g. `--card-border-color`. But I also don't have a good solution for these right now. The main issue that I have is that the scoped styles prevent us from accessing the global `.dark` class that is active on the `html` element in dark mode (Because `.dark` either points to a scoped `.dark` class **or** the nested classes will not be scoped when using `:globa()`). I have an idea, but that needs a change in vues sfc-compiler. I'm currently preparing an issue for this. For now let's keep the styles as they are, just wanted to have that mentioned.
adrinux added 1 commit 2021-11-15 13:31:33 +00:00
adrinux added 1 commit 2021-11-15 13:37:39 +00:00
continuous-integration/drone/pr Build is passing Details
2c695ef03a
Remove conflicts accidentaly committed.
adrinux added 1 commit 2021-11-15 14:51:13 +00:00
continuous-integration/drone/pr Build is passing Details
d7c592d6ab
Fix for table row text not visible on hover
adrinux added 1 commit 2021-11-15 16:14:54 +00:00
continuous-integration/drone/pr Build is passing Details
7e064053f9
Fix poor readability of dropdown menu items
adrinux added 1 commit 2021-11-15 16:28:41 +00:00
continuous-integration/drone/pr Build is passing Details
595a5e8145
Make dark mode shadows visible.
adrinux added 1 commit 2021-11-15 22:43:47 +00:00
continuous-integration/drone/pr Build is passing Details
f1ecf6d897
Still visible but better color shadows
adrinux added 1 commit 2021-11-15 22:52:39 +00:00
continuous-integration/drone/pr Build is passing Details
05cf268dd8
Typo fix.
adrinux added 1 commit 2021-11-16 12:10:09 +00:00
continuous-integration/drone/pr Build is failing Details
359a6b17d9
Make tertary buttons useable
Author
Contributor

The button-related stuff should be fixed in the button component for the "tertary" style, that's located at src/components/input/button.vue.

Still don't understand what's required with Vue to mark that delete button 'is-danger'.

Down to point 5.
So that's all that's missing?

But I have just pushed 359a6b17d9 which at least prevents the text from becoming invisible on hover.

I think that's the last visibly broken part made useable.

> The button-related stuff should be fixed in the button component for the "tertary" style, that's located at `src/components/input/button.vue`. Still don't understand what's required with Vue to mark that delete button 'is-danger'. > > Down to point 5. > So that's all that's missing? But I have just pushed https://kolaente.dev/adrinux/frontend/commit/359a6b17d99a298b3aed08e9c082221d6466482b which at least prevents the text from becoming invisible on hover. I think that's the last visibly broken part made useable.
adrinux added 1 commit 2021-11-16 12:18:52 +00:00
Member

RE:

I have an idea, but that needs a change in vues sfc-compiler. I'm currently preparing an issue for this.

I wrote something: https://github.com/vuejs/rfcs/discussions/414
Maybe you can give an upvote :D

RE: > I have an idea, but that needs a change in vues sfc-compiler. I'm currently preparing an issue for this. I wrote something: https://github.com/vuejs/rfcs/discussions/414 Maybe you can give an upvote :D
dpschen requested changes 2021-11-16 17:38:41 +00:00
@ -144,6 +144,12 @@ $vikunja-nav-logo-full-width: 164px;
.logo {
display: none;
color: var(--logo-text-color);

Put this in logo.vue

Put this in logo.vue

Done!

Done!
dpschen marked this conversation as resolved
@ -146,1 +146,4 @@
display: none;
color: var(--logo-text-color);
&:hover, &:focus {

This also in logo.vue

This also in logo.vue

Done!

Done!
dpschen marked this conversation as resolved
@ -38,1 +38,4 @@
}
.logo {
color: var(--logo-text-color);

Move to logo.vue

Move to logo.vue

Done!

Done!
dpschen marked this conversation as resolved
@ -0,0 +17,4 @@
--site-background: var(--grey-100);
--scheme-main: var(--white);
// Overrides of Bulma defaults

This comment is a bit unclear: where do the overwrites of bulmas defaults end?

This comment is a bit unclear: where do the overwrites of bulmas defaults end?
Author
Contributor

Tightened up the whitespace so all the overrides are in one block. That clearer?

Tightened up the whitespace so all the overrides are in one block. That clearer?

Tbh I liked that they were devided by an empty line. How about an end comment, something like:

// END OF Overrides of Bulma defaults
Tbh I liked that they were devided by an empty line. How about an end comment, something like: ``` // END OF Overrides of Bulma defaults ```
Author
Contributor

Tbh I liked that they were devided by an empty line. How about an end comment, something like:

// END OF Overrides of Bulma defaults

@dpschen You can have end comment if you prefer :) And empty lines back?

While we're talking about this block, how would feel about removing the comment lines with the old color name/hex etc?
Mostly in to show what I'd done but they seem superfluous now.

> Tbh I liked that they were devided by an empty line. How about an end comment, something like: > > ``` > // END OF Overrides of Bulma defaults > ``` @dpschen You can have end comment if you prefer :) And empty lines back? While we're talking about this block, how would feel about removing the comment lines with the old color name/hex etc? Mostly in to show what I'd done but they seem superfluous now.
Author
Contributor

Added end comment, added whitespace back, removed extra hsl in comment

Added end comment, added whitespace back, removed extra hsl in comment
@ -0,0 +26,4 @@
--grey-light: var(--grey-300);
--grey-lighter: var(--grey-200);
--grey-lightest: var(--grey-100);
// --white-ter: whitesmoke;

I didn't get what these uncommented values are for?

I didn't get what these uncommented values are for?
Author
Contributor

Thought I might need to override them when I started, removed them now.

Thought I might need to override them when I started, removed them now.
adrinux marked this conversation as resolved
@ -0,0 +71,4 @@
// simulate sass lighten($primary, 30) by increasing lightness 30% to 73%
--primary-light-l: 73%;
--primary-a: 1;
--primary-hsl: 216.5deg, 100%, 54.9%;

Reuse --primary-h, --primary-s and --primary-ls values

Reuse `--primary-h`, `--primary-s` and `--primary-l`s values

Done

Done
dpschen marked this conversation as resolved
@ -9,3 +9,3 @@
// FIXME: move to pagination component
.pagination-link:not(.is-current) {
background: $light-background;
background: var(--site-background);

It seems wrong to use here the site-background since this is a link – better just var(--grey-100)?

It seems wrong to use here the `site-background` since this is a link – better just `var(--grey-100)`?
Author
Contributor

That seems perfectly sensible. Done.

That seems perfectly sensible. Done.
adrinux marked this conversation as resolved
@ -843,3 +843,4 @@
}
&:not(:disabled) {
// HACK: these styles are repeated from bulma-css-variables/sass/form/shared.sass

Remove hack and replace colors with vars directly

Remove hack and replace colors with vars directly

Done!

Done!
dpschen marked this conversation as resolved
@ -61,0 +62,4 @@
}
/* Close icon SVG uses currentColor, change the color to keep it visible */
@media (prefers-color-scheme: dark) {

Respect .dark class.

Respect `.dark` class.

Done!

Done!
dpschen marked this conversation as resolved
adrinux added 1 commit 2021-11-16 17:50:01 +00:00
adrinux added 1 commit 2021-11-16 18:03:23 +00:00
adrinux added 1 commit 2021-11-16 18:21:01 +00:00
Owner

Still don't understand what's required with Vue to mark that delete button 'is-danger'.

This one is a little more complicated. The tertary action is defined in the <create-edit/> component here and could be anything, not just delete. Because it only allows passing in props with a button action and text we can't really style it. In order to re-style that class we would need to change that component to either allow adding arbitrary classes to its buttons or change it to use slots instead. Since that's not something strictly related to themeing I think we could leave it as-is for now, as long as the original issue with the tertary action class not being visible at all is solved.

> Still don't understand what's required with Vue to mark that delete button 'is-danger'. This one is a little more complicated. The tertary action is defined in the `<create-edit/>` component [here](https://kolaente.dev/vikunja/frontend/src/branch/main/src/components/misc/create-edit.vue#L16-L23) and could be anything, not just delete. Because it only allows passing in props with a button action and text we can't really style it. In order to re-style that class we would need to change that component to either allow adding arbitrary classes to its buttons or change it to use slots instead. Since that's not something strictly related to themeing I think we could leave it as-is for now, as long as the original issue with the tertary action class not being visible at all is solved.
adrinux added 4 commits 2021-11-16 21:46:02 +00:00
adrinux added 1 commit 2021-11-16 22:01:06 +00:00
adrinux added 2 commits 2021-11-16 22:35:03 +00:00
adrinux added 1 commit 2021-11-17 12:23:00 +00:00
continuous-integration/drone/pr Build is failing Details
5d78cd5b9c
Fix build error due to missed dependency during manual resolution of
upstream merge conflict
dpschen added a new dependency 2021-11-17 14:17:51 +00:00
Member

Still don't understand what's required with Vue to mark that delete button 'is-danger'.

This one is a little more complicated. The tertary action is defined in the <create-edit/> component here and could be anything, not just delete. Because it only allows passing in props with a button action and text we can't really style it. In order to re-style that class we would need to change that component to either allow adding arbitrary classes to its buttons or change it to use slots instead. Since that's not something strictly related to themeing I think we could leave it as-is for now, as long as the original issue with the tertary action class not being visible at all is solved.

Leave it as is for now.
I wanted to tackle a bit how this works either way =)

> > Still don't understand what's required with Vue to mark that delete button 'is-danger'. > > This one is a little more complicated. The tertary action is defined in the `<create-edit/>` component [here](https://kolaente.dev/vikunja/frontend/src/branch/main/src/components/misc/create-edit.vue#L16-L23) and could be anything, not just delete. Because it only allows passing in props with a button action and text we can't really style it. In order to re-style that class we would need to change that component to either allow adding arbitrary classes to its buttons or change it to use slots instead. Since that's not something strictly related to themeing I think we could leave it as-is for now, as long as the original issue with the tertary action class not being visible at all is solved. Leave it as is for now. I wanted to tackle a bit how this works either way =)
adrinux added 1 commit 2021-11-21 11:51:36 +00:00
continuous-integration/drone/pr Build is failing Details
4c6a5916f5
Add end comment, bring back whitespace, remove superfluous hsl in
comment
adrinux added 17 commits 2021-11-21 11:57:24 +00:00
continuous-integration/drone/push Build is failing Details
28b571588e
fix(deps): update dependency vue-i18n to v9.2.0-beta.19
continuous-integration/drone/push Build encountered an error Details
2656c74f37
feat: add postcss-preset-env (#1022)
Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: #1022
Reviewed-by: konrad <k@knt.li>
Co-authored-by: dpschen <dpschen@noreply.kolaente.de>
Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
continuous-integration/drone/push Build is passing Details
233b9693eb
chore(deps): update dependency typescript to v4.5.2 (#1024)
Reviewed-on: #1024
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
continuous-integration/drone/push Build is failing Details
ed6dc94873
feat: always use latest browserlist (#1021)
Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: #1021
Reviewed-by: konrad <k@knt.li>
Co-authored-by: dpschen <dpschen@noreply.kolaente.de>
Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
c5b539912d
fix(deps): update dependency vue-i18n to v9.2.0-beta.20
continuous-integration/drone/push Build is passing Details
745b4b56ec
chore(deps): update dependency eslint-plugin-vue to v8.1.1 (#1026)
Reviewed-on: #1026
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
continuous-integration/drone/push Build is passing Details
b838e7494d
fix attribute coercion for contenteditable (#1025)
Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: #1025
Reviewed-by: konrad <k@knt.li>
Co-authored-by: dpschen <dpschen@noreply.kolaente.de>
Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
continuous-integration/drone/push Build is passing Details
ced8e0fd3c
chore(deps): update dependency netlify-cli to v6.15.0 (#1028)
Reviewed-on: #1028
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
continuous-integration/drone/push Build is passing Details
01f3196938
chore(deps): update dependency netlify-cli to v7 (#1029)
Reviewed-on: #1029
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
continuous-integration/drone/push Build was killed Details
30aa1cd1cf
chore(deps): update dependency @types/jest to v27.0.3 (#1030)
Reviewed-on: #1030
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
continuous-integration/drone/push Build is failing Details
d55328e03b
chore(deps): update dependency vite-plugin-pwa to v0.11.6 (#1031)
Reviewed-on: #1031
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
943eab5e7e
fix(deps): update dependency date-fns to v2.26.0
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
8b2450d6f9
chore(deps): update dependency postcss-preset-env to v7.0.1
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
e342f6e3ed
fix(deps): update dependency marked to v4.0.4
continuous-integration/drone/push Build is passing Details
d41ee3dc8c
chore(deps): update dependency netlify-cli to v7.0.1
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
709ebdf567
chore(deps): update dependency netlify-cli to v7.0.2
adrinux requested review from dpschen 2021-11-21 12:07:15 +00:00
dpschen approved these changes 2021-11-21 12:33:04 +00:00
dpschen left a comment
Member

Looks good to me 💪

@konrad: what do you think?

Looks good to me 💪 @konrad: what do you think?
dpschen requested review from konrad 2021-11-22 20:28:05 +00:00
konrad was assigned by dpschen 2021-11-22 20:28:25 +00:00
konrad added 3 commits 2021-11-22 20:57:39 +00:00
8380e06ed6
Merge branch 'main' into bulma-css-variables
# Conflicts:
#	package.json
#	src/components/misc/no-auth-wrapper.vue
#	yarn.lock
continuous-integration/drone/pr Build is passing Details
df62580768
Merge remote-tracking branch 'adrinux/bulma-css-variables' into bulma-css-variables
# Conflicts:
#	package.json
#	src/components/misc/no-auth-wrapper.vue
#	yarn.lock
Owner

I've noticed three more things (not a blocker for merging this though):

  1. The selected command in the quick actions menu should use a different color:

image

  1. Links should have the primary color by default. You can see this here ("Edit" is a link):

image

  1. The borders in the table view should use a darker color:

image

I've noticed three more things (not a blocker for merging this though): 1. The selected command in the quick actions menu should use a different color: ![image](/attachments/2826745a-ec3f-4641-ba47-67bd2cfc174e) 2. Links should have the primary color by default. You can see this here ("Edit" is a link): ![image](/attachments/7ed776b3-fd4b-4b46-b6da-f947abc5e646) 3. The borders in the table view should use a darker color: ![image](/attachments/a3d9f990-b1eb-415d-af40-3be7c4420943)
konrad approved these changes 2021-11-22 21:10:55 +00:00
konrad left a comment
Owner

Looks good to me! Thanks a lot for your work.

Looks good to me! Thanks a lot for your work.
Owner

Moved my notes from the comment above to #1063, will merge this once CI passes.

Moved my notes from the comment above to https://kolaente.dev/vikunja/frontend/issues/1063, will merge this once CI passes.
konrad merged commit 46fa43d67f into main 2021-11-22 21:12:55 +00:00
konrad deleted branch bulma-css-variables 2021-11-22 21:12:55 +00:00
Member

Yay!! =)

Yay!! =)
This repo is archived. You cannot comment on pull requests.
No description provided.