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

Feat/dark theme support #199

Merged
merged 87 commits into from
Dec 6, 2022
Merged

Feat/dark theme support #199

merged 87 commits into from
Dec 6, 2022

Conversation

skjalgepalg
Copy link
Collaborator

@skjalgepalg skjalgepalg commented Oct 24, 2022

Add support for a default dark theme in core-docs

  • opt-in via configurable options
<script>
  window.coreDocs = {
    theme: { 
      label: 'dark mode', // theme switch label (default: 'dark mode')
      prefers: true // use system settings for light or dark mode (default: true)
    }
  }
</script>
  • theme optionally can adhere to user preferences prefers-color-scheme: dark
    • theme can be toggled by used and is saved in current session only
    • user toggled theme has higher presidency then system theme (toggle > prefers-color-scheme: dark)
  • possible to override CSS custom properties to control themes
  • migrate from deprecated code-prettify to highlight.js
  • use accessibility friendly code highlight themes A 11 Y DARK/LIGHT
  • toggle custom classes in code examples and demos with conditional classes class="{{ 'light' : 'dark' }}"
  • migrate to sass from css
  • default options; start core docs without window.coreDocs
  • extract styles to separate css file (browser seems to resolve it faster then when injected through js)

@skjalgepalg
Copy link
Collaborator Author

Screenshot 2022-10-24 at 08 34 22
Screenshot of docs-page in default dark theme with visible toggle

@skjalgepalg skjalgepalg added the enhancement New feature or request label Oct 24, 2022
readme.md Outdated Show resolved Hide resolved
@skjalgepalg
Copy link
Collaborator Author

Burde legge inn et notat i docs om at vi har tweaket noen av fargene i a11y-light for å fungere med noe mørkere bakgrunn

@klizter
Copy link
Contributor

klizter commented Dec 6, 2022

Burde legge inn et notat i docs om at vi har tweaket noen av fargene i a11y-light for å fungere med noe mørkere bakgrunn

ordner det 👨‍🔧

package.json Outdated Show resolved Hide resolved
src/index.scss Outdated Show resolved Hide resolved
src/readme.md Outdated Show resolved Hide resolved
@skjalgepalg skjalgepalg merged commit 3ade84f into master Dec 6, 2022
@skjalgepalg skjalgepalg deleted the feat/dark-theme-support branch December 6, 2022 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants