mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
misc: add IDE language annotation comments (#7678)
add IDE language annotations
This commit is contained in:
parent
9ce7d11309
commit
cebe4840aa
2 changed files with 5 additions and 1 deletions
|
@ -29,7 +29,9 @@ const ThemeStorageKey = 'theme';
|
||||||
const noFlashColorMode = ({
|
const noFlashColorMode = ({
|
||||||
defaultMode,
|
defaultMode,
|
||||||
respectPrefersColorScheme,
|
respectPrefersColorScheme,
|
||||||
}: ThemeConfig['colorMode']) => `(function() {
|
}: ThemeConfig['colorMode']) =>
|
||||||
|
/* language=js */
|
||||||
|
`(function() {
|
||||||
var defaultMode = '${defaultMode}';
|
var defaultMode = '${defaultMode}';
|
||||||
var respectPrefersColorScheme = ${respectPrefersColorScheme};
|
var respectPrefersColorScheme = ${respectPrefersColorScheme};
|
||||||
|
|
||||||
|
@ -76,6 +78,7 @@ const AnnouncementBarDismissDataAttribute =
|
||||||
// We always render the announcement bar html on the server, to prevent layout
|
// We always render the announcement bar html on the server, to prevent layout
|
||||||
// shifts on React hydration. The theme can use CSS + the data attribute to hide
|
// shifts on React hydration. The theme can use CSS + the data attribute to hide
|
||||||
// the announcement bar asap (before React hydration)
|
// the announcement bar asap (before React hydration)
|
||||||
|
/* language=js */
|
||||||
const AnnouncementBarInlineJavaScript = `
|
const AnnouncementBarInlineJavaScript = `
|
||||||
(function() {
|
(function() {
|
||||||
function isDismissed() {
|
function isDismissed() {
|
||||||
|
|
|
@ -43,6 +43,7 @@ function createInlineHtmlBanner(baseUrl: string) {
|
||||||
|
|
||||||
// Needs to work for older browsers!
|
// Needs to work for older browsers!
|
||||||
function createInlineScript(baseUrl: string) {
|
function createInlineScript(baseUrl: string) {
|
||||||
|
/* language=js */
|
||||||
return `
|
return `
|
||||||
window['${InsertBannerWindowAttribute}'] = true;
|
window['${InsertBannerWindowAttribute}'] = true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue