Add background-color to options of Syntax Switch.
This commit is contained in:
parent
037c1cb302
commit
3d3da33e3e
@ -2,15 +2,15 @@ import React from 'react';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
function SyntaxSwitch(props) {
|
||||
return React.createElement("select", {
|
||||
return /*#__PURE__*/React.createElement("select", {
|
||||
className: styles.syntaxSwitch,
|
||||
defaultValue: props.syntax,
|
||||
onChange: e => props.onSyntaxChange(e.target.value)
|
||||
}, React.createElement("option", {
|
||||
}, /*#__PURE__*/React.createElement("option", {
|
||||
value: "pascaligo"
|
||||
}, "PascaLIGO"), React.createElement("option", {
|
||||
}, "PascaLIGO"), /*#__PURE__*/React.createElement("option", {
|
||||
value: "cameligo"
|
||||
}, "CameLIGO"), React.createElement("option", {
|
||||
}, "CameLIGO"), /*#__PURE__*/React.createElement("option", {
|
||||
value: "reasonligo"
|
||||
}, "ReasonLIGO"));
|
||||
}
|
||||
|
@ -2,11 +2,11 @@ import React from 'react';
|
||||
import SyntaxContext from './SyntaxContext';
|
||||
|
||||
function Syntax(props) {
|
||||
return React.createElement(SyntaxContext.Consumer, null, syntax => {
|
||||
return /*#__PURE__*/React.createElement(SyntaxContext.Consumer, null, syntax => {
|
||||
if (syntax === props.syntax) {
|
||||
return props.children;
|
||||
} else {
|
||||
return React.createElement(React.Fragment, null);
|
||||
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
.syntaxSwitch option {
|
||||
color: var(--color-primary-text);
|
||||
font-weight:normal;
|
||||
background-color: var(--ifm-navbar-background-color);
|
||||
}
|
||||
|
||||
|
@ -72,9 +72,9 @@ function SyntaxTitle(props) {
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
}, []);
|
||||
return React.createElement(SyntaxContext.Consumer, null, syntax => {
|
||||
return /*#__PURE__*/React.createElement(SyntaxContext.Consumer, null, syntax => {
|
||||
if (syntax === props.syntax) {
|
||||
return React.createElement(Highlight, _extends({}, defaultProps, {
|
||||
return /*#__PURE__*/React.createElement(Highlight, _extends({}, defaultProps, {
|
||||
key: mounted,
|
||||
language: props.syntax,
|
||||
code: props.children,
|
||||
@ -85,7 +85,7 @@ function SyntaxTitle(props) {
|
||||
tokens,
|
||||
getLineProps,
|
||||
getTokenProps
|
||||
}) => React.createElement("pre", {
|
||||
}) => /*#__PURE__*/React.createElement("pre", {
|
||||
className: className,
|
||||
style: {
|
||||
backgroundColor: 'var(--ifm-background-color)',
|
||||
@ -95,15 +95,15 @@ function SyntaxTitle(props) {
|
||||
whiteSpace: 'break-spaces',
|
||||
marginTop: '3rem'
|
||||
}
|
||||
}, tokens.map((line, i) => React.createElement("div", getLineProps({
|
||||
}, tokens.map((line, i) => /*#__PURE__*/React.createElement("div", getLineProps({
|
||||
line,
|
||||
key: i
|
||||
}), line.map((token, key) => React.createElement("span", getTokenProps({
|
||||
}), line.map((token, key) => /*#__PURE__*/React.createElement("span", getTokenProps({
|
||||
token,
|
||||
key
|
||||
})))))));
|
||||
} else {
|
||||
return React.createElement("div", null);
|
||||
return /*#__PURE__*/React.createElement("div", null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
.syntaxSwitch option {
|
||||
color: var(--color-primary-text);
|
||||
font-weight:normal;
|
||||
background-color: var(--ifm-navbar-background-color);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user