Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !37658

docs: move color-mode script

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged XhmikosR requested to merge xmr/docs-color-script into main 2 years ago
  • Overview 6
  • Commits 5
  • Pipelines 0
  • Changes 3

Doesn't make any sense to have the script before charset and the other tags.

@mdo: Does the order need to be specific? If so, which one is it? Like, does this script need to be before CSS?

Also

  1. can't we asynchronously load the script or does it need to be blocking?
  2. can't /shouldn't we use DOMContentLoaded instead of window.load?
Compare
  • main (base)

and
  • latest version
    df586a00
    5 commits, 2 years ago

3 files
+ 5
- 5

    Preferences

    File browser
    Compare changes
si‎te‎
content/docs/‎5.2/customize‎
color-m‎odes.md‎ +1 -1
layouts/‎partials‎
heade‎r.html‎ +3 -3
static/docs/‎5.2/assets/js‎
color-m‎odes.js‎ +1 -1
site/content/docs/5.2/customize/color-modes.md
+ 1
- 1
  • View file @ df586a00

  • Edit in single-file editor

  • Open in Web IDE


@@ -248,7 +248,7 @@ Here's a look at the JavaScript that powers it. Feel free to inspect our own doc
{{< example lang="js" show_preview="false" >}}
{{< js.inline >}}
{{- readFile (path.Join "site/assets/js/color-modes/index.js") -}}
{{- readFile (path.Join "site/static/docs" .Site.Params.docs_version "assets/js/color-modes.js") -}}
{{< /js.inline >}}
{{< /example >}}
site/layouts/partials/header.html
+ 3
- 3
  • View file @ df586a00

  • Edit in single-file editor

  • Open in Web IDE


{{- $colorModeJS := resources.Get "js/color-modes/index.js" }}
<script src="{{ $colorModeJS.Permalink | relURL }}"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{{ .Page.Params.description | default .Site.Params.description | markdownify }}">
@@ -22,6 +19,9 @@
<meta name="robots" content="{{ . }}">
{{- end }}
{{- $colorModeJS := printf "/docs/%s/assets/js/color-modes.js" $.Site.Params.docs_version -}}
<script src="{{ $colorModeJS | relURL }}"></script>
{{ partial "stylesheet" . }}
{{ partial "favicons" . }}
{{ partial "social" . }}
site/assets/js/color-modes/index.js → site/static/docs/5.2/assets/js/color-modes.js
+ 1
- 1
  • View file @ df586a00

  • Edit in single-file editor

  • Open in Web IDE


@@ -46,7 +46,7 @@
}
})
window.addEventListener('load', () => {
window.addEventListener('DOMContentLoaded', () => {
showActiveTheme(getPreferredTheme())
document.querySelectorAll('[data-bs-theme-value]')
0 Assignees
None
Assign to
2 Reviewers
Julien Déramond's avatar
Julien Déramond
Mark Otto's avatar
Mark Otto
Request review from
Labels
2
color mode docs
2
color mode docs
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
5
5 participants
Mark Otto
Julien Déramond
Administrator
XhmikosR
Ghost User
Reference: twbs/bootstrap!37658
Source branch: xmr/docs-color-script

Menu

Explore Projects Groups Snippets