Skip to content

Commit 9456fbf

Browse files
committed
First version of snippets
0 parents  commit 9456fbf

File tree

5 files changed

+169
-0
lines changed

5 files changed

+169
-0
lines changed

all-caps-internal-links.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.cm-s-obsidian span.cm-hmd-internal-link,
2+
.markdown-preview-view .internal-link {
3+
text-decoration: none;
4+
font-weight: 550;
5+
text-transform: uppercase;
6+
font-size: .9em;
7+
letter-spacing: .125em;
8+
border-radius: 4px;
9+
}

clean-embeds-all.css

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/*
2+
clean-embeds-all.css snippet
3+
4+
Removes title, link, padding, margins from embeds,
5+
so they really look like the same note.
6+
7+
This will not require a `cssclass` to be set but work for _all_ notes.
8+
Derived from the `clean-embeds.css` snippet.
9+
10+
2021-08-24 Matthias C. Hormann (Moonbase59)
11+
12+
TODO: Find out how to correct PDF export. L/R margins & vspace too large on embeds.
13+
*/
14+
15+
/* remove title and the table from the "Metatable" plugin */
16+
.markdown-preview-view .markdown-embed-title,
17+
.markdown-preview-view .obsidian-metatable {
18+
display: none;
19+
}
20+
21+
/*
22+
For links to embeds NOT to be shown, uncomment the following
23+
and comment out the other section below.
24+
*/
25+
26+
/*
27+
.markdown-preview-view .markdown-embed-link,
28+
.markdown-preview-view .file-embed-link {
29+
display: none;
30+
}
31+
*/
32+
33+
/*
34+
For links to embeds to BE shown, uncomment the following
35+
until the "End link show/hide stuff" comment
36+
and comment out the section above.
37+
*/
38+
39+
/* Link icon */
40+
.markdown-preview-view .markdown-embed-link,
41+
.markdown-preview-view .file-embed-link {
42+
top: 0;
43+
right: 0;
44+
left: unset;
45+
text-align: right;
46+
border: none;
47+
margin: 0;
48+
width: 24px;
49+
height: 24px;
50+
color: var(--text-faint);
51+
cursor: pointer;
52+
}
53+
54+
/* for Ars Magna theme and others that change ::before */
55+
.markdown-preview-view .markdown-embed-link::before,
56+
.markdown-preview-view .file-embed-link::before {
57+
display: none;
58+
}
59+
60+
/* Link icon size & hide */
61+
.markdown-preview-view .file-embed-link svg,
62+
.markdown-preview-view .markdown-embed-link svg {
63+
height: 24px;
64+
width: 24px;
65+
opacity: 0;
66+
display: unset;
67+
}
68+
69+
/* show on hover */
70+
.markdown-preview-view .markdown-embed:hover .file-embed-link svg,
71+
.markdown-preview-view .markdown-embed:hover .markdown-embed-link svg {
72+
opacity: 1;
73+
}
74+
75+
/* change background on hover, to exactly see what’s embedded */
76+
.markdown-preview-view .markdown-embed:hover,
77+
.markdown-preview-view .file-embed:hover {
78+
background-color: var(--background-secondary) !important;
79+
}
80+
81+
/* End link show/hide stuff */
82+
83+
84+
85+
/* remove border and scroll */
86+
/* unfortunately needs !important for some themes */
87+
.markdown-preview-view .markdown-embed,
88+
.markdown-preview-view .file-embed {
89+
border: none !important;
90+
padding: 0 !important;
91+
margin: 0 !important;
92+
}
93+
94+
.markdown-preview-view .markdown-embed-content,
95+
.markdown-preview-view .markdown-embed-content > .markdown-preview-view {
96+
max-height: unset;
97+
padding: 0 !important; /* !important for "Pisum" theme */
98+
margin: 0;
99+
border: 0;
100+
}
101+
102+
/* remove <br> between internal embeds */
103+
.markdown-preview-section div > br {
104+
display: none;
105+
}
106+
107+
108+
/* remove vertical space added by markdown-preview-sizer */
109+
div.markdown-preview-sizer.markdown-preview-section {
110+
min-height: unset !important;
111+
padding-bottom: 0 !important;
112+
}
113+
114+
/* special considerations for printing (PDF export) */
115+
@media print {
116+
117+
/* remove frontmatter box if "Show frontmatter" was enabled */
118+
/* Also remove metadata table from "Metatable" plugin */
119+
pre.frontmatter,
120+
.obsidian-metatable {
121+
display: none;
122+
}
123+
}

disable_strikethrough_checkbox.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* From this thread: https://forum.obsidian.md/t/how-to-remove-strikethrough-for-checkboxes/5753/16 */
2+
3+
.markdown-preview-view ul > li.task-list-item.is-checked {
4+
text-decoration:none;
5+
color:var(--text-normal);
6+
}
7+
8+
.markdown-preview-view ol > li.task-list-item.is-checked {
9+
text-decoration:none;
10+
color:var(--text-normal);
11+
}
12+
13+
.markdown-source-view.mod-cm6 .HyperMD-task-line[data-task]:not([data-task=" "]) {
14+
text-decoration:none;
15+
color: var(--text-normal);
16+
}

highlight-bold-darkmode.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.theme-dark .cm-strong {
2+
font-weight: 550;
3+
text-transform: uppercase;
4+
font-size: .9em;
5+
letter-spacing: .125em;
6+
border-radius: 4px;
7+
text-decoration: underline;
8+
}
9+
10+

justified.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* reading mode */
2+
.markdown-preview-view p {
3+
text-align: justify;
4+
text-justify: inter-word;
5+
}
6+
7+
/* source view and live preview */
8+
.markdown-source-view.mod-cm6 .cm-line {
9+
text-align: justify;
10+
text-justify: inter-word;
11+
}

0 commit comments

Comments
 (0)