Skip to content

Commit

Permalink
fix: jupyter styling not applied (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
imfing authored Sep 14, 2024
1 parent 2af73b3 commit de9f9b3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
17 changes: 17 additions & 0 deletions assets/css/compiled/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2577,6 +2577,23 @@ nav .search-wrapper {
grid-template-columns: repeat(var(--hextra-feature-grid-cols), minmax(0, 1fr))
}
}
.hextra-jupyter-code-cell {
scrollbar-gutter: auto;
margin-top: 1.5rem;
}
.hextra-jupyter-code-cell .hextra-jupyter-code-cell-outputs-container {
overflow: hidden;
font-size: .75rem;
}
.hextra-jupyter-code-cell .hextra-jupyter-code-cell-outputs-container .hextra-jupyter-code-cell-outputs {
max-height: 50vh;
overflow: auto;
}
.hextra-jupyter-code-cell .hextra-jupyter-code-cell-outputs-container .hextra-jupyter-code-cell-outputs pre {
max-width: 100%;
overflow: auto;
font-size: .75rem;
}
html {
font-size: 1rem;
-webkit-font-smoothing: antialiased;
Expand Down
16 changes: 2 additions & 14 deletions assets/css/components/jupyter.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,15 @@

@apply hx-mt-6;

.hextra-jupyter-code-cell-source {
@apply hx-text-sm;
.chroma,
pre {
@apply hx-m-0;
}
}

.hextra-jupyter-code-cell-outputs-container {
@apply hx-text-xs hx-overflow-hidden hx-border hx-border-t-0 hx-rounded-b-xl dark:hx-border-neutral-800;
@apply hx-text-xs hx-overflow-hidden;

.hextra-jupyter-code-cell-outputs {
@apply hx-overflow-auto hx-max-h-[50vh];

pre {
@apply hx-p-4;
@apply hx-text-xs hx-overflow-auto hx-max-w-full;
}
}
}
}

.hextra-jupyter-code-cell:has(.hextra-jupyter-code-cell-outputs) .hextra-jupyter-code-cell-source .chroma {
@apply hx-rounded-b-none;
}
1 change: 1 addition & 0 deletions assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@import "components/scrollbar.css";
@import "components/code-copy.css";
@import "components/hextra/feature-grid.css";
@import "components/jupyter.css";

html {
@apply hx-text-base hx-antialiased;
Expand Down
4 changes: 2 additions & 2 deletions layouts/shortcodes/jupyter.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
{{- else if eq (index $output "output_type") "stream" -}}
{{- $text := index $output "text" -}}
{{- $textContent := (cond (reflect.IsSlice $text) (delimit $text "") $text) -}}
<pre class="not-prose hx-text-sm">{{- $textContent -}}</pre>
<pre class="not-prose">{{- $textContent -}}</pre>
{{- else if eq (index $output "output_type") "execute_result" -}}
{{- $data := index $output "data" -}}
{{- $text := index $data "text/plain" -}}
{{- $textContent := (cond (reflect.IsSlice $text) (delimit $text "") $text) -}}
<pre class="not-prose hx-text-sm">{{- $textContent -}}</pre>
<pre class="not-prose">{{- $textContent -}}</pre>
{{- $html := index $data "text/html" -}}
{{- if $html -}}
{{- $htmlText := delimit $html "" -}}
Expand Down

0 comments on commit de9f9b3

Please sign in to comment.