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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

css variable/pseudo element doesn't update between pages #709

Open
thiskevinwang opened this issue Mar 7, 2021 · 0 comments
Open

css variable/pseudo element doesn't update between pages #709

thiskevinwang opened this issue Mar 7, 2021 · 0 comments

Comments

@thiskevinwang
Copy link

thiskevinwang commented Mar 7, 2021

馃悰 Bug

CSS Variable in <style jsx>... doesn't update between pages

Tiny Demo Repo + Deployment

Expected

The UI should display

on /

  • HOME HOME

and on /other

  • OTHER OTHER

Observed

The CSS variable / pseudo-element doesn't update on route change

on /

  • HOME HOME

on /other

  • HOME OTHER

Notes

A Browser-refresh updates the --content css variable accordingly

Workaround

It's possible to fix this issue if the const itself has a different name, per page

// index.js
const one = "HOME"

// other.js
- const one = "OTHER"
+ const two = "OTHER"

but this seems weird/unnecessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant