Skip to content

Commit

Permalink
refactor: perhaps standartized link colors
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Feb 3, 2024
1 parent 6780a94 commit ae0dfd1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
8 changes: 7 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ tasks:
- templ generate
- go run . --act=build

dev:
dev:templ:
cmds:
- templ generate -watch --proxy="http://localhost:8080" --cmd="go run . --act=web"

dev:web:
cmds:
- task: build
- go run . --act=web

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
With modern logging systems able to parse JSON out of the box, we need to define easily jsonable logs. The alternative to define regex for parsing logs is a rather dreadful fragile experience limited in its nature.
Known solutions do not do it consistently and in a type safe way. It is easy to shoot into your own legs with them.

Structured logging became part of std library [for golang]((https://go.dev/blog/slog)),
Structured logging became part of std library [for golang](https://go.dev/blog/slog) ,
as well part of official documentation [for python](https://docs.python.org/3/howto/logging-cookbook.html#implementing-structured-logging). Golang managed to reach a rather big comfort out of the box, but it has some parts missing... like type safety. U can insert Any objects into logging msgs easily. [Python std way](https://docs.python.org/3/howto/logging-cookbook.html#implementing-structured-logging) is in even more raw state. And they all lack a way to do it in a type safe way.

For reading [what is type safety, check here](http://www.pl-enthusiast.net/2014/08/05/type-safety/) (archived [html]({{.StaticRoot}}typelog/what_is_type safety_ThePLEnthusiast.html) / [pdf]({{.StaticRoot}}typelog/what_is_type safety_ThePLEnthusiast.pdf))
Expand Down
3 changes: 1 addition & 2 deletions blog/common/common_static/common.templ
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ templ CommonCSS() {
margin-top: 10px;
margin-bottom: 10px;
}

a, a:visited, a:hover, a:active {
color: inherit;
color: var(--color_link);
font-weight: bold;
}
a {
Expand Down
5 changes: 0 additions & 5 deletions blog/common/common_static/custom.templ
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ package common_static

templ CustomCSS() {
<style data-custom-css>
:root {
--color_hover_link: #4183C4;
--color_link: #33618E;
/* color: var(--blue); how to apply*/
}
/*My custom stuff*/

.blog_space {
Expand Down
27 changes: 20 additions & 7 deletions blog/common/shared.templ
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ templ LightSwitch(gp types.GlobalParams, pagepath string) {
</style>
switch gp.Theme {
case types.ThemeDark:
<style>
body {
background: #000;
color: #fff;
}
</style>

<div class="light_switch">
<a href={ templ.URL(gp.OppositeThemeRoot + pagepath ) } >
<img id="light_switch" src={ gp.StaticRoot + "common/switch_to_light.png" }/>
Expand All @@ -50,6 +43,26 @@ templ Html5(gp types.GlobalParams, pagepath string, title Title) {
<html>
<head>
<title>{ string(title) }</title>
switch gp.Theme {
case types.ThemeDark:
<style>
:root {
--color_hover_link: #4183C4;
--color_link: #91C3F5;
}
body {
background: #000;
color: #fff;
}
</style>
case types.ThemeLight:
<style>
:root {
--color_hover_link: #4183C4;
--color_link: #33618E;
}
</style>
}
@highlight.IncludeHighlight(gp)
@common_static.ResetCSS()
@common_static.CommonCSS()
Expand Down

0 comments on commit ae0dfd1

Please sign in to comment.