The three Rushikesh CSS Snippets (code below) Centered Tables, Left-Column Headers, and Spoiler Text, all run in Reading Mode but not in Live Preview Mode or Source Mode. How do I edit the CSS files to run in Live Preview and Source Modes? I have seen there are several different ways to render in Live Preview mode and am not sure which to use.
I was thinking something like this at the top of each snippet…
.markdown-preview-view, .markdown-source-view, .markdown-rendered
Please advise.
Thanks
.markdown-preview-view table {
margin-left: auto;
margin-right: auto;
}
/*
author: zamsyt
source: https://discord.com/channels/686053708261228577/702656734631821413/1076475103006687232
*/
:is(.cm-table-widget, .markdown-preview-section > div):has(+ * .left-thead) th {
font-weight: unset;
}
:is(.cm-table-widget, .markdown-preview-section > div):has(+ * .left-thead)
> table
> *
> tr
> :first-child {
font-weight: var(--table-header-weight);
background-color: var(--background-secondary);
}
/*
author: pseudometa
source: https://discord.com/channels/686053708261228577/702656734631821413/893816224247586868
*/
/* pseudo(meta) spoiler tags */
/* blacks out non-hovered-nonactive text surrounded in *~~text~~* */
.theme-light {
--spoiler-bg: #111;
}
.theme-dark {
--spoiler-bg: #eee;
}
div:not(.CodeMirror-activeline) > .CodeMirror-line .cm-em.cm-strikethrough,
em > del {
font-style: initial;
text-decoration: unset;
background-color: var(--spoiler-bg);
color: var(--spoiler-bg);
}
.CodeMirror-activeline > .CodeMirror-line .cm-em.cm-strikethrough,
em > del:hover,
.cm-em.cm-strikethrough:hover {
background-color: var(--background-secondary-alt) !important;
}