Skip to content

Commit 4dd5b9f

Browse files
authored
Merge pull request #12 from AnswerDotAI/dark-callout
Add example darkmode style for callouts
2 parents 804dae5 + 7a059fa commit 4dd5b9f

1 file changed

Lines changed: 64 additions & 19 deletions

File tree

nbs/00_core.ipynb

Lines changed: 64 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -795,24 +795,54 @@
795795
"data": {
796796
"text/html": [
797797
"<style>\n",
798-
"[class*=\"callout-\"] { border-left: 4px solid var(--clr); background: var(--bg);\n",
799-
" padding: 0.8em 1em; border-radius: 4px; margin: 0.5em 0; }\n",
800-
".callout-note { --clr: #4a9eff; --bg: #f0f7ff; }\n",
801-
".callout-warning { --clr: #f0ad4e; --bg: #fff8f0; }\n",
802-
".callout-tip { --clr: #5cb85c; --bg: #f0fff0; }\n",
803-
".callout-important { --clr: #d9534f; --bg: #fff0f0; }\n",
798+
"[class*=\"callout-\"] {\n",
799+
" border-left: 4px solid var(--clr);\n",
800+
" background: var(--bg);\n",
801+
" color: var(--fg);\n",
802+
" padding: 0.8em 1em;\n",
803+
" border-radius: 4px;\n",
804+
" margin: 0.5em 0;\n",
805+
"}\n",
806+
"\n",
807+
".callout-note { --clr:#4a9eff; --bg:#f0f7ff; --fg:#123; }\n",
808+
".callout-warning { --clr:#f0ad4e; --bg:#fff8f0; --fg:#2b2114; }\n",
809+
".callout-tip { --clr:#5cb85c; --bg:#f0fff0; --fg:#132913; }\n",
810+
".callout-important { --clr:#d9534f; --bg:#fff0f0; --fg:#2b1111; }\n",
811+
"\n",
812+
"@media (prefers-color-scheme: dark) {\n",
813+
" .callout-note { --bg:#102235; --fg:#d8ecff; }\n",
814+
" .callout-warning { --bg:#2b2113; --fg:#ffe4bd; }\n",
815+
" .callout-tip { --bg:#142816; --fg:#d8f5d8; }\n",
816+
" .callout-important { --bg:#2b1515; --fg:#ffd6d6; }\n",
817+
"}\n",
818+
"\n",
804819
".columns { display: flex; gap: 1em; }\n",
805820
".column { flex: 1; }\n",
806821
"</style>\n"
807822
],
808823
"text/plain": [
809824
"HTML(<style>\n",
810-
"[class*=\"callout-\"] { border-left: 4px solid var(--clr); background: var(--bg);\n",
811-
" padding: 0.8em 1em; border-radius: 4px; margin: 0.5em 0; }\n",
812-
".callout-note { --clr: #4a9eff; --bg: #f0f7ff; }\n",
813-
".callout-warning { --clr: #f0ad4e; --bg: #fff8f0; }\n",
814-
".callout-tip { --clr: #5cb85c; --bg: #f0fff0; }\n",
815-
".callout-important { --clr: #d9534f; --bg: #fff0f0; }\n",
825+
"[class*=\"callout-\"] {\n",
826+
" border-left: 4px solid var(--clr);\n",
827+
" background: var(--bg);\n",
828+
" color: var(--fg);\n",
829+
" padding: 0.8em 1em;\n",
830+
" border-radius: 4px;\n",
831+
" margin: 0.5em 0;\n",
832+
"}\n",
833+
"\n",
834+
".callout-note { --clr:#4a9eff; --bg:#f0f7ff; --fg:#123; }\n",
835+
".callout-warning { --clr:#f0ad4e; --bg:#fff8f0; --fg:#2b2114; }\n",
836+
".callout-tip { --clr:#5cb85c; --bg:#f0fff0; --fg:#132913; }\n",
837+
".callout-important { --clr:#d9534f; --bg:#fff0f0; --fg:#2b1111; }\n",
838+
"\n",
839+
"@media (prefers-color-scheme: dark) {\n",
840+
" .callout-note { --bg:#102235; --fg:#d8ecff; }\n",
841+
" .callout-warning { --bg:#2b2113; --fg:#ffe4bd; }\n",
842+
" .callout-tip { --bg:#142816; --fg:#d8f5d8; }\n",
843+
" .callout-important { --bg:#2b1515; --fg:#ffd6d6; }\n",
844+
"}\n",
845+
"\n",
816846
".columns { display: flex; gap: 1em; }\n",
817847
".column { flex: 1; }\n",
818848
"</style>\n",
@@ -826,12 +856,27 @@
826856
"source": [
827857
"%%html\n",
828858
"<style>\n",
829-
"[class*=\"callout-\"] { border-left: 4px solid var(--clr); background: var(--bg);\n",
830-
" padding: 0.8em 1em; border-radius: 4px; margin: 0.5em 0; }\n",
831-
".callout-note { --clr: #4a9eff; --bg: #f0f7ff; }\n",
832-
".callout-warning { --clr: #f0ad4e; --bg: #fff8f0; }\n",
833-
".callout-tip { --clr: #5cb85c; --bg: #f0fff0; }\n",
834-
".callout-important { --clr: #d9534f; --bg: #fff0f0; }\n",
859+
"[class*=\"callout-\"] {\n",
860+
" border-left: 4px solid var(--clr);\n",
861+
" background: var(--bg);\n",
862+
" color: var(--fg);\n",
863+
" padding: 0.8em 1em;\n",
864+
" border-radius: 4px;\n",
865+
" margin: 0.5em 0;\n",
866+
"}\n",
867+
"\n",
868+
".callout-note { --clr:#4a9eff; --bg:#f0f7ff; --fg:#123; }\n",
869+
".callout-warning { --clr:#f0ad4e; --bg:#fff8f0; --fg:#2b2114; }\n",
870+
".callout-tip { --clr:#5cb85c; --bg:#f0fff0; --fg:#132913; }\n",
871+
".callout-important { --clr:#d9534f; --bg:#fff0f0; --fg:#2b1111; }\n",
872+
"\n",
873+
"@media (prefers-color-scheme: dark) {\n",
874+
" .callout-note { --bg:#102235; --fg:#d8ecff; }\n",
875+
" .callout-warning { --bg:#2b2113; --fg:#ffe4bd; }\n",
876+
" .callout-tip { --bg:#142816; --fg:#d8f5d8; }\n",
877+
" .callout-important { --bg:#2b1515; --fg:#ffd6d6; }\n",
878+
"}\n",
879+
"\n",
835880
".columns { display: flex; gap: 1em; }\n",
836881
".column { flex: 1; }\n",
837882
"</style>"
@@ -1098,7 +1143,7 @@
10981143
"metadata": {
10991144
"solveit": {
11001145
"default_code": false,
1101-
"mode": "concise",
1146+
"mode": "learning",
11021147
"use_fence": true,
11031148
"use_thinking": true,
11041149
"use_tools": true,

0 commit comments

Comments
 (0)