Skip to content

Instantly share code, notes, and snippets.

@ms3056
Last active September 22, 2024 03:55
Show Gist options
  • Save ms3056/c89f5fdfee830ef7a84a654dbaf61e0c to your computer and use it in GitHub Desktop.
Save ms3056/c89f5fdfee830ef7a84a654dbaf61e0c to your computer and use it in GitHub Desktop.
Collection of Obsidian Snippets
- ActiveLine.css
- Callouts.css
/* You must turn ON line numbers even though they are not displayed */
/* Adapted from Vane6413 on Discord - this is mainly his code I have */
/* only adapted and tweaked it after some experimentation */
/* The colors are based on the accent color. */
.cm-scroller
{
padding-left: 5px !important;
}
.markdown-source-view .inline-title
{
padding-bottom: 1.15em;
}
.markdown-source-view.mod-cm6.is-live-preview div.cm-editor div {
caret-color: var(--color-accent);
}
/* edit bar */
.cm-gutter {
overflow: visible !important;
}
.cm-gutters
{
padding-right: 15px !important;
}
.cm-gutterElement{
display: flex;
justify-content: center;
align-items: center;
font-size: 0px;
transform: translate(2px, -1px);
min-width: 10px !important;
/* If you don't use the AnuPpuccin theme uncomment this line:*/
background-color: hsla(var(--accent-h),var(--accent-s),var(--accent-l), 0.1);
/* If you don't use the AnuPpuccin theme comment this line: */
/* background-color: rgba(var(--ctp-accent), 0.05); */
}
.cm-gutterElement.cm-active{
position: relative;
background-color: var(--color-accent); /* change me */
box-shadow: rgba(0, 0, 0, 0.9) 0px 0px 19px 0px !important;
border-radius: 5px;
}
.cm-gutterElement:nth-child(2)
{
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.cm-gutterElement:last-child
{
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
/* Background of active line */
.cm-active.cm-line {
filter: brightness(1.3) !important;
background-color: rgba(var(--ctp-accent),0.05);
margin-top: 10px;
}
/* Center align Icons and Title for callouts */
/* Thanks @FireIsGood on Discord */
/* The format: */
/* > [!today | ninety or base | collapsed | color ] */
/* > [!today | ninety | collapsed | default ] */
/* > [!today | base | collapsed | blue, orange, etc] */
.theme-dark, .theme-light {
--callout-background: var(--background-primary);
}
.theme-dark {
--gradient-start: 0.20;
}
.theme-light {
--gradient-start: 0.35;
}
/* These commands affect ALL callouts - custom or not */
.callout-title {
align-items: center !important;
justify-content: center !important;
font-weight: bold;
font-size: 1.2em;
text-shadow: 2px 2px 2px black;
}
.callout-fold,
.callout-icon,
.callout-title-inner {
margin-top: unset !important;
margin-bottom: unset !important;
margin-left: unset !important;
margin-right: unset !important;
align-self: unset !important;
}
.callout {
border-radius: 10px !important;
transition: 200ms !important;
}
.callout-content {
background-color: var(--callout-background) !important;
}
.callout:hover {
border: 3px solid rgba(var(--callout-color), 1.2) !important;
}
/* */
/* Base Styling */
/* */
.callout[data-callout-metadata*=base] {
display: flex;
flex-direction: column;
border-radius: 10px;
justify-content: flex-start;
align-items: flex-start;
}
.callout[data-callout-metadata*=base] .svg-icon.lucide-chevron-down {
transform: rotate(180deg);
}
.callout[data-callout-metadata*=base] .callout-title,
.callout[data-callout-metadata*=base] .callout-title-inner {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
white-space: nowrap;
flex-shrink: 0;
margin-left: 10px;
margin-top: 10px;
}
.callout[data-callout-metadata*=base] .callout-title,
.callout[data-callout-metadata*=base] .callout-title-inner,
.callout[data-callout-metadata*=base] .callout-content {
line-height: 1.5em;
}
.callout[data-callout-metadata*=base] .callout-title {
--icon-size: 1.5em;
}
.callout[data-callout-metadata*=base] .callout-title-inner {
font-size: 1.4em;
}
.callout[data-callout-metadata*=base] .callout-content {
border-radius: 10px;
margin: 10px;
padding: 10px;
width: calc(100% - 20px);
background-color: var(--callout-background);
flex-grow: 1;
}
/* Today Callout */
.callout[data-callout="today"]
.callout-fold,
.callout-icon,
.callout-title-inner {
margin-top: unset !important;
margin-bottom: unset !important;
margin-left: unset !important;
margin-right: unset !important;
padding-top: unset !important;
padding-bottom: unset !important;
padding-left: unset !important;
padding-right: unset !important;
align-self: unset !important;
}
.callout[data-callout="today"] .callout-fold,
.callout[data-callout="today"] .callout-icon,
.callout[data-callout="today"] .callout-title-inner {
margin: unset;
padding: unset;
align-self: unset;
}
.callout[data-callout="today"] {
--callout-icon: calendar;
--callout-blend-mode: normal;
background: linear-gradient(90deg, rgba(var(--callout-color), var(--gradient-start)) 0%, rgba(var(--callout-color), 0.6)100%);
}
.callout[data-callout="today"] .svg-icon.lucide-calendar,
.callout[data-callout="today"] .svg-icon.lucide-chevron-down,
.callout[data-callout="today"] .callout-title-inner {
color: var(--callout-color);
}
.callout[data-callout="today"] .callout-title-inner {
filter: brightness(0.9);
}
.callout[data-callout="today"] .callout-content {
background-color: var(--background-primary-alt);
border-left: 3px dashed rgba(var(--callout-color), 0.7);
font-size: 1.2em;
}
/* Preamble */
.callout[data-callout="preamble"]
.callout-fold,
.callout-icon,
.callout-title-inner {
margin-top: unset !important;
margin-bottom: unset !important;
margin-left: unset !important;
margin-right: unset !important;
padding-top: unset !important;
padding-bottom: unset !important;
padding-left: unset !important;
padding-right: unset !important;
align-self: unset !important;
}
.callout[data-callout="preamble"] .callout-fold,
.callout[data-callout="preamble"] .callout-icon,
.callout[data-callout="preamble"] .callout-title-inner {
margin: unset;
padding: unset;
align-self: unset;
}
.callout[data-callout="preamble"] {
--callout-icon: calendar;
--callout-blend-mode: normal;
background: linear-gradient(90deg, rgba(var(--callout-color), var(--gradient-start)) 0%, rgba(var(--callout-color), 0.6)100%);
}
.callout[data-callout="preamble"] .svg-icon.lucide-calendar,
.callout[data-callout="preamble"] .svg-icon.lucide-chevron-down,
.callout[data-callout="preamble"] .callout-title-inner {
color: var(--callout-color);
}
.callout[data-callout="preamble"] .callout-title-inner {
filter: brightness(0.9);
}
.callout[data-callout="preamble"] {
--callout-icon: calendar-check;
}
.callout[data-callout="preamble"] .callout-content {
background-color: var(--background-primary-alt);
border-left: 3px dashed rgba(var(--callout-color), 0.7);
font-size: 1.2em;
}
/* Rotate Icons and Title 90° */
.callout[data-callout-metadata*=ninety] .svg-icon.lucide-chevron-down {
transform: rotate(-90deg);
}
.callout[data-callout-metadata*=ninety] {
display: grid;
grid-template-columns: auto auto 1fr;
align-items: center;
border-radius: 10px;
min-height: 210px;
}
.callout[data-callout-metadata*=ninety] .callout-title {
--icon-size: 1.3em;
gap: 10px;
grid-column: 1;
transform: rotate(-90deg) translateY(-150%);
line-height: 1.5em;
margin-right: -3em;
}
.callout[data-callout-metadata*=ninety] .callout-title-inner {
grid-column: 1;
font-size: 1.4em;
}
.callout[data-callout-metadata*=ninety] .callout-content {
grid-column: 3;
border-radius: 10px;
padding: 10px;
width: calc(100% + 10px);
margin: 10px 0px 10px -20px;
}
/* Collapsed Callout Styling */
.callout.is-collapsible.is-collapsed[data-callout-metadata*=collapsed] {
display: flex;
justify-content: center;
align-items: center;
min-height: 0px;
}
.callout.is-collapsible.is-collapsed[data-callout-metadata*=collapsed] .callout-title,
.callout.is-collapsible.is-collapsed[data-callout-metadata*=collapsed] .callout-title-inner {
display: flex;
justify-content: center;
align-items: center;
transform: rotate(0deg);
padding: 0;
margin: 10px;
}
.callout.is-collapsible.is-collapsed[data-callout-metadata*=collapsed] .svg-icon.lucide-chevron-down {
transform: rotate(0deg);
}
.callout.is-collapsible.is-collapsed[data-callout-metadata*=collapsed] .callout-title-inner {
margin-right: 10px;
}
/* Custom Color List */
/* This color is specific to the AnuPpuccin theme */
.callout[data-callout-metadata*="accent"] {
--callout-color: var(--ctp-accent);
background-color: var(--ctp-accent);
}
.callout[data-callout-metadata*="orange"] {
--callout-color: 255, 217, 102;
}
.callout[data-callout-metadata*="red"] {
--callout-color: 174, 140, 163;
}
.callout[data-callout-metadata*="green"] {
--callout-color: 153, 169, 143;
}
.callout[data-callout-metadata*="gray"] {
--callout-color: 162, 171, 181;
}
.callout[data-callout-metadata*="blue"] {
--callout-color: 183, 196, 207;
}
.callout[data-callout-metadata*="gold"] {
--callout-color: 209, 172, 0;
}
.callout[data-callout-metadata*="coquelicot"] {
--callout-color: 255, 64, 0 ;
}
.callout[data-callout-metadata*="maize"] {
--callout-color: 242, 232, 109 ;
}
.callout[data-callout-metadata*="moonstone"] {
--callout-color: 72, 159, 181 ;
}
.callout[data-callout-metadata*="nonphotoblue"] {
--callout-color: 132, 199, 208 ;
}
/* This will follow the default UI accent color set in the UI */
/* Settings → Appearance → Accent Color */
.callout[data-callout-metadata*="default"] {
--callout-color: hsl(var(--accent-h),var(--accent-s),var(--accent-l));
background-color: hsla(var(--accent-h),var(--accent-s),var(--accent-l), 0.3);
}
@ms3056
Copy link
Author

ms3056 commented Jun 14, 2023

2023-07-16_10h17_09

2023-07-16_10h17_55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment