Skip to content

Commit

Permalink
KAW-7711-image-center variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakshmishri committed Aug 2, 2024
1 parent 5e1cb38 commit 057032d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion blocks/image/image.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
display: flex;
}

.block.image img {
.block.image img:not(.image--center img) {
width: 100%;
object-fit: cover;
}

.image--center picture {
justify-content: center;
}
9 changes: 7 additions & 2 deletions blocks/image/image.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export default async function decorate() {
// JS code
import { variantsClassesToBEM } from '../../scripts/scripts.js';

Check failure on line 1 in blocks/image/image.js

View workflow job for this annotation

GitHub Actions / build

variantsClassesToBEM not found in '../../scripts/scripts.js'

const variantClasses = ['center'];
const blockName = 'image';

export default async function decorate(block) {
variantsClassesToBEM(block.classList, variantClasses, blockName);
}

0 comments on commit 057032d

Please sign in to comment.