Skip to content
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

Dark mode #313

Open
yiendos opened this issue Oct 11, 2019 · 7 comments · May be fixed by #401
Open

Dark mode #313

yiendos opened this issue Oct 11, 2019 · 7 comments · May be fixed by #401
Assignees
Labels
Milestone

Comments

@yiendos
Copy link
Member

yiendos commented Oct 11, 2019

Seems there is a CSS proposal at present to introduce support for determining whether the user's browser has been configured to support Dark Mode:
https://stuffandnonsense.co.uk/blog/redesigning-your-product-and-website-for-dark-mode

It was agreed that if we could introduce this to the joomlatools-ui as a hidden Easter egg this would be fun for our users.
https://timble.slack.com/archives/C027CR8UF/p1570783467000200

@yiendos yiendos added this to the 3.3 milestone Oct 11, 2019
@yiendos yiendos self-assigned this Oct 11, 2019
@yiendos
Copy link
Member Author

yiendos commented Oct 14, 2019

work in progress

Screenshot 2019-10-14 at 11 36 36

inspiration from the mac calendar app:

Screenshot 2019-10-14 at 11 37 19

@yiendos
Copy link
Member Author

yiendos commented Oct 28, 2019

Seems scss variables can't be used with a media prefers dark mode:
https://rowlandekemezie.com/posts/dark-theme-support-for-my-website/
https://jeremenichelli.io/2019/05/a-css-variables-implementation-of-dark-mode/
https://sass-lang.com/documentation/breaking-changes/css-vars
https://codepen.io/jakealbaugh/post/css4-variables-and-sass
sass/libsass#2621 (comment)

Only support for root variables are possible:
https://css-tricks.com/almanac/selectors/r/root/

Take a look at first link and see how easy it would be to convert scss variables to css variables

@yiendos
Copy link
Member Author

yiendos commented Oct 29, 2019

It seems that css variable support isn't that good:
https://caniuse.com/#search=css%20variables

So I guess working out two stylesheets (admin.css and admin-dark.css):

    <link href="/dist/css/admin.css" rel="stylesheet">
    <link href="/dist/css/admin.css" rel="stylesheet" media="(prefers-color-scheme: light)">
    <link href="/dist/css/admin-dark.css" rel="stylesheet" media="(prefers-color-scheme: dark)">

At least this way the default admin.css will be picked up by browsers that don't support the prefers-color-scheme attribute

@johanjanssens johanjanssens modified the milestones: 3.3, 3.4 Nov 16, 2019
johanjanssens added a commit that referenced this issue Nov 28, 2019
@johanjanssens johanjanssens modified the milestones: 3.4, Backlog Dec 23, 2019
@yiendos yiendos linked a pull request Jul 6, 2020 that will close this issue
yiendos added a commit that referenced this issue Jul 6, 2020
yiendos added a commit that referenced this issue Jul 7, 2020
@yiendos
Copy link
Member Author

yiendos commented Jul 8, 2020

@ercanozkaya question about fonts. Mason attempts to copy the fonts folder:

from:
~/Projects/kodekit-ui/dist/fonts

to:
~/Projects/joomlatools-framework/code/libraries/joomlatools/library/resources/assets/fonts

Yet when you symlink joomlatools-framework into a site:

joomla site:create testing --symlink=joomlatools-framework

[12:51 PM]-[vagrant@joomlatools]-[/var/www/testing/media/koowa] 

$ ls -la | grep "com_koowa"

5:lrwxrwxrwx  1 501 dialout  104 Jul  8 12:37 com_koowa -> /home/vagrant/Projects/joomlatools-framework/code/libraries/joomlatools/component/koowa/resources/assets/

You can see the symlink is in fact made to:

~/Projects/joomlatools-framework/code/libraries/joomlatools/component/koowa/resources/assets/

So subsequent calls to the font folder fail:

http://testing.test/media/koowa/com_koowa/fonts/k-icons/k-icons.ttf

What is the proper location for our fonts? Or is the way folders symlinked into the joomla console incorrect?

@ercanozkaya
Copy link
Member

@yiendos Fonts have been moved into libraries/joomlatools/library/resources/assets/fonts

The fonts should then come from media/koowa/framework and CSS files should refer to that location. Where does the error come from, which CSS file?

@yiendos
Copy link
Member Author

yiendos commented Jul 23, 2020

@ercanozkaya mind giving this a spin please?

Testing instructions

  1. Check out the following branches:

    • joomlatools-framework:feature/313-darkMode
    • kodekit-ui:feature/73-darkVariables
  2. Run mason css over the framework

  3. Create a new docman site joomla site:create docman --symlink=joomlatools-framework,docman

  4. Install DOCman db tables

  5. Access the admin UX

Let there be dark!

@ercanozkaya
Copy link
Member

@yiendos This is super super nice :) I think it looks better than it does on Wordpress since there is no sidebar either.

Happy to incorporate this into core once we clean it up. We have a refactored loader in Foliokit for dark mode loader. Would you be willing to bring that over and also clean up the extra font files etc?

Btw sorry for the late response this came right in between my holiday business so couldn't test earlier

@johanjanssens johanjanssens changed the title Investigate dark mode Easter egg Dark mode Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants