mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-10 15:39:01 +00:00
indentation lines: fix #51, full support for toggle headers
This commit is contained in:
parent
7358873fba
commit
ad248ece6b
@ -9,9 +9,7 @@
|
|||||||
.notion-page-content .notion-numbered_list-block > div > div:last-child,
|
.notion-page-content .notion-numbered_list-block > div > div:last-child,
|
||||||
.notion-page-content .notion-to_do-block > div > div:last-child,
|
.notion-page-content .notion-to_do-block > div > div:last-child,
|
||||||
.notion-page-content .notion-toggle-block > div > div:last-child,
|
.notion-page-content .notion-toggle-block > div > div:last-child,
|
||||||
.notion-page-content .notion-selectable.notion-sub_header-block > div > div > div:last-child,
|
.notion-page-content [class$='header-block'] > div > div > div:last-child,
|
||||||
.notion-page-content .notion-selectable.notion-sub_sub_header-block > div > div > div:last-child,
|
|
||||||
.notion-page-content .notion-selectable.notion-sub_sub_sub_header-block > div > div > div:last-child,
|
|
||||||
.notion-page-content .notion-table_of_contents-block > div > div > a > div > div {
|
.notion-page-content .notion-table_of_contents-block > div > div > a > div > div {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -20,9 +18,7 @@
|
|||||||
.notion-page-content .notion-numbered_list-block > div > div:last-child::before,
|
.notion-page-content .notion-numbered_list-block > div > div:last-child::before,
|
||||||
.notion-page-content .notion-to_do-block > div > div:last-child::before,
|
.notion-page-content .notion-to_do-block > div > div:last-child::before,
|
||||||
.notion-page-content .notion-toggle-block > div > div:last-child::before,
|
.notion-page-content .notion-toggle-block > div > div:last-child::before,
|
||||||
.notion-page-content .notion-selectable.notion-sub_header-block > div > div > div:last-child::before,
|
.notion-page-content [class$='header-block'] > div > div > div:last-child::before,
|
||||||
.notion-page-content .notion-selectable.notion-sub_sub_header-block > div > div > div:last-child::before,
|
|
||||||
.notion-page-content .notion-selectable.notion-sub_sub_sub_header-block > div > div > div:last-child::before,
|
|
||||||
.notion-page-content .pseudoSelection > div > div:last-child::before {
|
.notion-page-content .pseudoSelection > div > div:last-child::before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -30,6 +26,9 @@
|
|||||||
top: 2em;
|
top: 2em;
|
||||||
margin-inline-start: -14.48px;
|
margin-inline-start: -14.48px;
|
||||||
}
|
}
|
||||||
|
.notion-page-content [class$='header-block'] > div > div > div:last-child::before {
|
||||||
|
margin-inline-start: -15.48px;
|
||||||
|
}
|
||||||
|
|
||||||
.notion-page-content
|
.notion-page-content
|
||||||
.notion-table_of_contents-block
|
.notion-table_of_contents-block
|
||||||
@ -100,4 +99,3 @@
|
|||||||
> .plus:hover {
|
> .plus:hover {
|
||||||
background: var(--theme--ui_interactive-hover) !important;
|
background: var(--theme--ui_interactive-hover) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,22 +48,26 @@ export default async function ({ web }, db) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await db.get(['toggle_header'])) {
|
if (await db.get(['toggle_header'])) {
|
||||||
css += `
|
css += `
|
||||||
.notion-page-content .notion-selectable.notion-sub_sub_header-block > div > div > div:last-child::before {
|
.notion-page-content [class$=header-block] > div > div > div:last-child::before {
|
||||||
border-left: 1px ${style} var(--indentation_lines--color, currentColor);
|
|
||||||
opacity: ${opacity};
|
|
||||||
}
|
|
||||||
.notion-page-content .notion-selectable.notion-sub_header-block > div > div > div:last-child::before {
|
|
||||||
border-left: 1px ${style} var(--indentation_lines--color, currentColor);
|
|
||||||
opacity: ${opacity};
|
|
||||||
}
|
|
||||||
.notion-page-content .notion-selectable.notion-sub_sub_sub_header-block > div > div > div:last-child::before {
|
|
||||||
border-left: 1px ${style} var(--indentation_lines--color, currentColor);
|
border-left: 1px ${style} var(--indentation_lines--color, currentColor);
|
||||||
opacity: ${opacity};
|
opacity: ${opacity};
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
|
if (rainbow) {
|
||||||
|
for (let i = 0; i < colors.length; i++) {
|
||||||
|
css += `
|
||||||
|
.notion-page-content ${`[class$=header-block] `.repeat(i + 1)}
|
||||||
|
> div > div > div:last-child::before{
|
||||||
|
--indentation_lines--color: var(--theme--text_${colors[i]});
|
||||||
|
}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (db.get(['table_of_contents'])) {
|
|
||||||
|
if (await db.get(['table_of_contents'])) {
|
||||||
css += `
|
css += `
|
||||||
.notion-page-content .notion-table_of_contents-block > div > div > a > div
|
.notion-page-content .notion-table_of_contents-block > div > div > a > div
|
||||||
> div:not([style*='margin-left: 0px']) > div::before {
|
> div:not([style*='margin-left: 0px']) > div::before {
|
||||||
@ -84,7 +88,7 @@ export default async function ({ web }, db) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (db.get(['outliner'])) {
|
if (await db.get(['outliner'])) {
|
||||||
css += `
|
css += `
|
||||||
.outliner--header:not([style='--outliner--indent:0px;'])::before {
|
.outliner--header:not([style='--outliner--indent:0px;'])::before {
|
||||||
border-left: 1px ${style} var(--indentation_lines--color, currentColor);
|
border-left: 1px ${style} var(--indentation_lines--color, currentColor);
|
||||||
|
Loading…
Reference in New Issue
Block a user