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

[FEATURE] implement dark mode #42

Open
ghost opened this issue Feb 21, 2022 · 8 comments
Open

[FEATURE] implement dark mode #42

ghost opened this issue Feb 21, 2022 · 8 comments
Labels
beginner enhancement New feature or request help wanted Extra attention is needed ui UI/UX Issues ux

Comments

@ghost
Copy link

ghost commented Feb 21, 2022

styles are inlined/internal only. To keep latency low and avoid any render blocking resource, we might need to keep using internal css, but there is a way to re-use and import common css by using Go nested templates.

This can be achieved easily as follows:

common-css.html

{{ define "common-css" }}
<style type="text/css">
// common css code here ...
</style>
{{ end }}

landing.html

<head:>
...
{{ template "common-css" }}
</head>
...

Please see discussions and issues

@ghost ghost added enhancement New feature or request help wanted Extra attention is needed ui UI/UX Issues ux beginner labels Feb 21, 2022
@ghost ghost mentioned this issue Feb 21, 2022
@vitaly-zdanevich
Copy link

For me this is already possible to start working on this issue or I need to wait to some refactor to finish?

@ghost
Copy link
Author

ghost commented Feb 21, 2022

I am not aware of anybody working on the nested template refactoring yet, so If you want you can give it a go :)

I am not sure how you want to implement it? I guess some sort of button to switch on and off dark mode? Open to your suggestions

@vitaly-zdanevich
Copy link

@ghost
Copy link
Author

ghost commented Feb 21, 2022

I think it will be pretty straightforward then, you can either copy pasta all the dark mode css everywhere or create the dark-mode-css.html nested template as shown above so it can be re-used. Up to how best works for you :)

@vitaly-zdanevich
Copy link

Thanks. How can I check my changes locally without installing Docker, PostgreSQL?

@ghost
Copy link
Author

ghost commented Feb 21, 2022

Right now you must need the following in order to run it locally: Bash, Go, Docker. You can just run a script to set it up. ./setup-database.sh - are you having issues with Docker? You don't need to install PostgreSQL locally you just need docker running and the bash script will do the rest

vitaly-zdanevich added a commit to vitaly-zdanevich/golang.cafe that referenced this issue Feb 21, 2022
@vitaly-zdanevich
Copy link

Do not want to pollute my system with Docker, I will try with Devtools only :)

@ghost
Copy link
Author

ghost commented Feb 21, 2022

fair enough - not sure if there are other ways you can test this locally. Docker is a pretty standard tool for dev work. Can use postgres installed locally as well. But up to you really. Open to suggestions for better dev experience if you have any

@ghost ghost linked a pull request Feb 21, 2022 that will close this issue
@ghost ghost changed the title implement dark mode [FEATURE] implement dark mode Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner enhancement New feature or request help wanted Extra attention is needed ui UI/UX Issues ux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant