Skip to content

Commit

Permalink
Bumping compton to get ability to set attributes on page html, body
Browse files Browse the repository at this point in the history
Using that to tint product pages to rep color
  • Loading branch information
boggydigital committed Nov 5, 2024
1 parent fb496af commit ad359eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/boggydigital/atomus v0.1.9
github.com/boggydigital/backups v0.1.3
github.com/boggydigital/clo v1.0.4
github.com/boggydigital/compton v0.2.10
github.com/boggydigital/compton v0.2.11
github.com/boggydigital/coost v0.3.9
github.com/boggydigital/dolo v0.2.18
github.com/boggydigital/issa v0.1.16
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ github.com/boggydigital/compton v0.2.9 h1:t7UfkUoUg5J3+wF8ls8ho0RnvhWNaZDbfM5NaB
github.com/boggydigital/compton v0.2.9/go.mod h1:dj/yZ2cCfts6+heUS60Favateu+gNTIsoxfX6yNZWLg=
github.com/boggydigital/compton v0.2.10 h1:k3eYN2XFdoIYZz0cQqzVv5Y5TeHEKy5b+UfrB9v+je0=
github.com/boggydigital/compton v0.2.10/go.mod h1:dj/yZ2cCfts6+heUS60Favateu+gNTIsoxfX6yNZWLg=
github.com/boggydigital/compton v0.2.11 h1:snxsfhzTulFisgUjAozTeNRL93EEIo2wWqGZL70/orU=
github.com/boggydigital/compton v0.2.11/go.mod h1:dj/yZ2cCfts6+heUS60Favateu+gNTIsoxfX6yNZWLg=
github.com/boggydigital/coost v0.3.9 h1:lMfR5PyexBDR4xDOQp0zWZWUk/Dqlrx7gw7i7XdsC4c=
github.com/boggydigital/coost v0.3.9/go.mod h1:w7ChGaah1DKsBIXb9ANdILg2pe2Jp7JkNpnK2R6rBec=
github.com/boggydigital/dolo v0.2.18 h1:aN/Bq55e0/9VgmVTNw0ru3aoS6lpZJI59ho5YQlFbDE=
Expand Down
6 changes: 6 additions & 0 deletions rest/compton_pages/product.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ func Product(id string, rdx kevlar.ReadableRedux, hasSections []string) compton.
p, pageStack := compton_fragments.AppPage(title)
p.RegisterStyles(compton_styles.Styles, "product.css")

// tinting document background color to the representative product color
alpha := "5%"
if repColor, ok := rdx.GetLastVal(vangogh_local_data.RepImageColorProperty, id); ok {
p.SetAttribute("style", "background-color:color-mix(in display-p3,"+repColor+" "+alpha+",var(--c-background))")
}

/* App navigation */

appNavLinks := compton_fragments.AppNavLinks(p, "")
Expand Down

0 comments on commit ad359eb

Please sign in to comment.