docs: use all.css for prefixed styles (#1221)

* docs: remove .bx--content override

* docs(ui-shell): add note on UI Shell theming

* docs(grid): touch up grid examples

* docs(theme): wrap localStorage in try catch

So that the site still works in Safari with all cookies blocked.

* docs: use prefixed all.css

Without vendor prefixes, some styles are lost in Safari.

* docs: remove svelte-preprocess from svelte.config.js
This commit is contained in:
metonym 2022-04-02 11:45:29 -07:00 committed by GitHub
commit d34f571150
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 601 additions and 1714 deletions

View file

@ -9,14 +9,20 @@
const isValidTheme = (value) => themes.includes(value);
onMount(() => {
const persisted_theme = localStorage.getItem(persistKey);
if (isValidTheme(persisted_theme)) theme.set(persisted_theme);
try {
const persisted_theme = localStorage.getItem(persistKey);
if (isValidTheme(persisted_theme)) theme.set(persisted_theme);
} catch (e) {}
});
afterUpdate(() => {
if (isValidTheme($theme)) {
document.documentElement.setAttribute("theme", $theme);
if (persist) localStorage.setItem(persistKey, $theme);
if (persist) {
try {
localStorage.setItem(persistKey, $theme);
} catch (e) {}
}
}
});
</script>