Skip to content

Commit

Permalink
Use a better checkbox rendering in a task list
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
  • Loading branch information
dhenneke committed Nov 16, 2021
1 parent 19a400b commit f770398
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/techdocs-sharp-knives-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs': patch
---

Use a better checkbox rendering in a task list.
16 changes: 14 additions & 2 deletions plugins/techdocs/src/reader/components/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ export const useTechDocsReaderDom = (): Element | null => {
.md-typeset .admonition, .md-typeset details {
font-size: 1rem;
}
/* style the checkmarks of the task list */
.md-typeset .task-list-control .task-list-indicator::before {
background-color: ${theme.palette.action.disabledBackground};
}
.md-typeset .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
background-color: ${theme.palette.success.main};
}
/**/
@media screen and (max-width: 76.1875em) {
.md-nav {
background-color: ${theme.palette.background.default};
Expand Down Expand Up @@ -293,8 +303,8 @@ export const useTechDocsReaderDom = (): Element | null => {
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
}
:host {
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
}
`,
}),
Expand All @@ -305,9 +315,11 @@ export const useTechDocsReaderDom = (): Element | null => {
namespace,
scmIntegrationsApi,
techdocsStorageApi,
theme.palette.action.disabledBackground,
theme.palette.background.default,
theme.palette.background.paper,
theme.palette.primary.main,
theme.palette.success.main,
theme.palette.text.primary,
theme.typography.fontFamily,
],
Expand Down

0 comments on commit f770398

Please sign in to comment.