Skip to content

Commit

Permalink
Nest CSS, add aspect ratio to figure
Browse files Browse the repository at this point in the history
  • Loading branch information
Melissa Piper committed Apr 25, 2024
1 parent 359d9c3 commit 808e95b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
26 changes: 15 additions & 11 deletions wp-content/themes/wp-starter/src/styles/blocks/logo-grid.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
@layer components {
.acf-block-logo-grid figure {
@apply flex;
@apply basis-1/2-gap lg:basis-1/4-gap;
}
.acf-block-logo-grid {
& figure {
@apply flex;
@apply aspect-grid-image;
@apply basis-1/2-gap lg:basis-1/4-gap;

.acf-block-logo-grid figure img {
@apply block;
@apply max-w-full;
}
& img {
@apply block;
@apply max-w-full h-full;
@apply object-contain;
}
}

/* Fix for image sizing in editor */
.acf-block-logo-grid .components-resizable-box__container {
@apply !shrink;
/* Fix for image sizing in editor */
& .components-resizable-box__container {
@apply !shrink;
}
}
}
3 changes: 3 additions & 0 deletions wp-content/themes/wp-starter/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export default {
contentSmall: minBreakpoint.toString(),
contentBase: maxBreakpoint.toString(),
extend: {
aspectRatio: {
'grid-image': '5/3',
},
colors: {
transparent: 'transparent',
//If you update the names or add more colors you will need to update the file in theme-json/settings/color.js
Expand Down

0 comments on commit 808e95b

Please sign in to comment.