Skip to content

Conversation

@YvetteNikolov
Copy link
Contributor

Galerij styling juist gezet

Als je deze optie uit zet:

Screenshot 2026-01-15 at 09 56 00

Krijg je de class is-cropped op de gallerij en verdwijnt object-fit: cover;. Deze optie is perfect om voor bijv. logo's te gebruiken (wat je vaak op home pagina's ziet), alleen is de styling niet perfect.

Deze PR verandert dit:

Screenshot 2026-01-15 at 09 52 34

Naar dit:

Screenshot 2026-01-15 at 09 52 23

Zo kun je vrij gemakkelijk een sectie met partners tonen.

Mobiel:

Screenshot 2026-01-15 at 09 52 17

.wp-block-gallery {
/* Not cropped usually means images like logo's */
&:not( .is-cropped ) {
figure.wp-block-image {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik haat deze diepe nesting maar het moet om de Gutenberg styles te overschrijven zonder !important

Copy link
Contributor

@laravdiemen laravdiemen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goeie! Ik gebruikte vaak een extra style voor dit soort dingen maar dit is beter.

}

img {
@apply max-w-4/5!;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misschien nog wel de border-radius voor de zekerheid weghalen? In blocks/wp/shared krijgen alle image een border-radius maar dat wil je bij logo's niet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toegevoegd!

Comment on lines 1 to 23
.wp-block-gallery {
/* Not cropped usually means images like logo's */
&:not( .is-cropped ) {
figure.wp-block-image {
@apply mt-auto! items-center;

/* Overwrite Gutenberg default styles */
@variant max-sm {
width: calc(
25% - var( --wp--style--unstable-gallery-gap, 16px ) / 2
) !important;
}

img {
@apply max-w-4/5!;
}

/* Editor styling */
> a,
> div {
@apply flex items-center justify-center;
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je kunt 1 nested niveau hier weg halen toch? Door dit achter elkaar te zetten maar wel met spatie er tussen houd jezelfde niveau aan importance hmm..

maar 1 minder tab :)

Suggested change
.wp-block-gallery {
/* Not cropped usually means images like logo's */
&:not( .is-cropped ) {
figure.wp-block-image {
@apply mt-auto! items-center;
/* Overwrite Gutenberg default styles */
@variant max-sm {
width: calc(
25% - var( --wp--style--unstable-gallery-gap, 16px ) / 2
) !important;
}
img {
@apply max-w-4/5!;
}
/* Editor styling */
> a,
> div {
@apply flex items-center justify-center;
}
}
}
}
.wp-block-gallery {
/* Not cropped usually means images like logo's */
&:not( .is-cropped ) figure.wp-block-image {
@apply mt-auto! items-center;
/* Overwrite Gutenberg default styles */
@variant max-sm {
width: calc(
25% - var( --wp--style--unstable-gallery-gap, 16px ) / 2
) !important;
}
img {
@apply max-w-4/5!;
}
/* Editor styling */
> a,
> div {
@apply flex items-center justify-center;
}
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goeie, done ✅

@YvetteNikolov YvetteNikolov force-pushed the fix/gallery-is-cropped-styling branch 2 times, most recently from 4c5ff3e to b6c9f87 Compare January 15, 2026 11:37
@YvetteNikolov YvetteNikolov force-pushed the fix/gallery-is-cropped-styling branch from b6c9f87 to a868803 Compare January 15, 2026 11:38
@YvetteNikolov YvetteNikolov merged commit af78d98 into main Jan 15, 2026
1 check passed
@YvetteNikolov YvetteNikolov deleted the fix/gallery-is-cropped-styling branch January 15, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants