Skip to content

Commit

Permalink
Merge pull request #594 from lwnoble/main
Browse files Browse the repository at this point in the history
left nav
  • Loading branch information
lwnoble authored Sep 20, 2023
2 parents 2f8628e + e91cebb commit 7916fd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
12 changes: 6 additions & 6 deletions code/src/ui/src/mui-a11y-tb/themes/Theme.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,18 +428,18 @@ try {
opacity: "1",
},
'& .MuiList-root.MuiMenu-list .MuiMenuItem-root:hover': {
color: "var(--on-dropdown-hover-bg)",
background: "var(--dropdown-hover-bg)",
background: "transparent",
borderLeft: "4x solid var(--button-half)",
opacity: "1",
},
'& .MuiList-root.MuiMenu-list .MuiMenuItem-root:focus': {
color: "var(--on-dropdown-focus-bg)",
background: "var(--dropdown-focus-bg)",
background: "transparent",
borderLeft: "4x solid var(--button)",
opacity: "1",
},
'& .MuiList-root.MuiMenu-list .MuiMenuItem-root.Mui-selected': {
color: "var(--on-dropdown-focus-bg)",
background: "var(--dropdown-focus-bg)",
background: "transparent",
borderLeft: "4x solid var(--button)",
opacity: "1",
},
borderRadius: "var(--spacing-half)",
Expand Down
22 changes: 13 additions & 9 deletions code/src/ui/src/pages/content/code/CodeContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ export const CodeContent: React.FC<Props> = ({ user, designSystem }) => {
return designSystem.code.jsonGenerator.getMotionSensitivityAsString();
}

const getJsonCode = (lm: boolean) => {
const code = designSystem.code.getJSON(lm);
const getJsonCodeDM = () => {
const code = designSystem.code.getJSONLM();
return JSON.stringify(code,null,2);
}

const getJsonCodeLM = () => {
const code = designSystem.code.getJSONLM();
return JSON.stringify(code,null,2);
}

Expand All @@ -99,7 +104,6 @@ export const CodeContent: React.FC<Props> = ({ user, designSystem }) => {
return JSON.stringify(code,null,2);
}


const saveFile = (data: string, fileName: string) => {
var file = new File([data], fileName, {type: "text/plain;charset=utf-8"});
FileSaver.saveAs(file);
Expand Down Expand Up @@ -215,20 +219,20 @@ export const CodeContent: React.FC<Props> = ({ user, designSystem }) => {
<div className="top40">
<InputLabel>Light Mode Theme Layer</InputLabel>
<pre style={codeStyle}>
{getJsonCode(true)}
{getJsonCodeLM()}
</pre>
<Button variant="contained" onClick={() => navigator.clipboard.writeText(getJsonCode(true))}>Copy</Button>
<Button variant="contained" onClick={() => navigator.clipboard.writeText(getJsonCodeLM())}>Copy</Button>
<span style={{paddingLeft: "20px"}}> &nbsp;</span>
<Button variant="outlined" onClick={() => saveFile(getJsonCode(true), designSystem.name + "-darkmode.json")}>Download</Button>
<Button variant="outlined" onClick={() => saveFile(getJsonCodeLM(), designSystem.name + "-darkmode.json")}>Download</Button>
</div>
<div className="top40">
<InputLabel>Dark Mode Theme Layer</InputLabel>
<pre style={codeStyle}>
{getJsonCode(false)}
{getJsonCodeDM()}
</pre>
<Button variant="contained" onClick={() => navigator.clipboard.writeText(getJsonCode(false))}>Copy</Button>
<Button variant="contained" onClick={() => navigator.clipboard.writeText(getJsonCodeDM())}>Copy</Button>
<span style={{paddingLeft: "20px"}}> &nbsp;</span>
<Button variant="outlined" onClick={() => saveFile(getJsonCode(false), designSystem.name + "-darkmode.json")}>Download</Button>
<Button variant="outlined" onClick={() => saveFile(getJsonCodeDM(), designSystem.name + "-darkmode.json")}>Download</Button>
</div>
</Grid>
</Grid>
Expand Down

0 comments on commit 7916fd5

Please sign in to comment.