Skip to content

Theme switcher should not added via a script tag, in general do we support browsers w/o js ?  #1920

@Carreau

Description

@Carreau

the theme switcher does:

<script>
document.write(`
  <button ...>
...
  </button>
`);
</script>

I believe this is bad practice as it will block rendering while js is executed to insert this. Which makes the theme slower. We could use I belive:

<head>
    <noscript><style> .jsonly { display: none } </style></noscript>
</head>

And just have whatever is js only be not displayed when there is no JS.

But in general we do rely on a bunch of other things that need JS (More dropdown in navbar requires js).

So maybe we should assume we always have JS ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions