Skip to content

Commit

Permalink
css: complete adding goat support
Browse files Browse the repository at this point in the history
  • Loading branch information
indrora committed Jan 29, 2024
1 parent 5d73283 commit f090b4d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
27 changes: 27 additions & 0 deletions assets/docs/scss/custom/structure/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,33 @@ i {
}
}


// goat diagrams
figure.goat.svg-container {

padding: 0.1rem;
align-items: center;
width: 100%;
@include media-breakpoint-up(md) {
width: auto;
padding:.5rem;
padding-left: auto;
padding-right: auto;
}
@include media-breakpoint-up(lg) {
padding: 1rem;
}
svg {
width:100%;
@include media-breakpoint-up(lg) {
max-width: 60rem;
}
font-family: var(--bs-font-monospace);
font-size: 0.7rem;
}
}


// Chroma Highlighter CSS
.docs-content .main-content td pre {

Expand Down
14 changes: 3 additions & 11 deletions assets/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,17 @@ $font-family-monospace: {{ .Site.Params.mono_font | default "SFMono-Regular, Me
// Structure
@import "custom/structure/general";
@import "custom/structure/topbar";
// @import "custom/structure/content";
// @import "custom/structure/sidebar-layouts";
// @import "custom/structure/doc-nav";
// @import "custom/structure/toc-layouts";
@import "custom/structure/footer";

// // Components
// Components
@import "custom/components/buttons";
@import "custom/components/badge";
@import "custom/components/backgrounds";
// @import "custom/components/alerts";
// @import "custom/components/card";

// // Pages
// Pages
// @import "custom/pages/blog";

@import "custom/pages/features";
@import "custom/pages/helper";
@import "custom/pages/hero";
{{ if ($.Scratch.Get "image_compare_enabled") }}@import "custom/pages/image-compare-viewer";{{ end }}
@import "custom/pages/image-compare-viewer";

// @import "custom/pages/simplebar";
18 changes: 18 additions & 0 deletions layouts/docs/_markup/render-codeblock-goat.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ $width := .Attributes.width }}
{{ $height := .Attributes.height }}
{{ $class := .Attributes.class | default "" }}
<figure class="goat svg-container {{ $class }}">
{{ with diagrams.Goat .Inner }}
<svg
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="xMinYMin"
{{ if or $width $height }}
{{ with $width }}width="{{ . }}"{{ end }}
{{ with $height }}height="{{ . }}"{{ end }}
{{ else }}
viewBox="0 0 {{ .Width }} {{ .Height }}"
{{ end }}>
{{ .Inner }}
</svg>
{{ end }}
</figure>

0 comments on commit f090b4d

Please sign in to comment.