Skip to content

Commit

Permalink
add media size
Browse files Browse the repository at this point in the history
  • Loading branch information
sebousan committed Jun 18, 2024
1 parent a3161d9 commit 4d6459b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/sass/components/_doc.sass
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
&:hover
--bs-card-bg: #{$gray-200}
.media
--bs-aspect-ratio: 100%
background-color: $gray-100
border: var(--bs-card-border-width) solid var(--bs-card-border-color)
border-radius: var(--bs-card-border-radius)
height: 2.5rem
margin-left: var(--bs-card-spacer-x)
margin-top: var(--bs-card-spacer-y)
width: 2.5rem
Expand Down
6 changes: 3 additions & 3 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module:
params:
docs:
thumbnail:
desktop: '50x50'
desktop: '38x38'
desktop_large: '100x100'
mobile: '50x50'
scrollsnap: '50x50'
mobile: '38x38'
scrollsnap: '38x38'
10 changes: 8 additions & 2 deletions layouts/partials/docs/item/media.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{{ $desktop := site.Params.thumbnail.desktop | default false }}
{{ $mobile := site.Params.thumbnail.mobile | default false }}
{{- $desktop := site.Params.docs.thumbnail.desktop | default false -}}
{{- $mobile := site.Params.docs.thumbnail.mobile | default false -}}
{{- if .Scratch.Get "large" -}}
{{- $desktop = site.Params.docs.thumbnail.desktop_large | default $desktop -}}
{{- end -}}
{{- if .Scratch.Get "scrollsnap" -}}
{{- $mobile = site.Params.docs.thumbnail.scrollsnap | default false -}}
{{- end -}}
<div class="media">
{{ with .Params.image }}
{{ partial "commons/image.html" (dict
Expand Down

0 comments on commit 4d6459b

Please sign in to comment.