Skip to content

Commit

Permalink
fix: use special img
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Jun 26, 2024
1 parent 852087c commit f43db8d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/elements/image/image.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@
.sbb-image__img {
position: absolute;
inset: 0;
opacity: 0;
opacity: 0.000001;

:host([data-loaded]) & {
opacity: 1;
opacity: 0.999999;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/elements/image/image.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { waitForImageReady } from '../core/testing.js';

import './image.js';

const imageUrl = import.meta.resolve('../core/testing/assets/lucerne.png');
const imageUrl = import.meta.resolve('../core/testing/assets/placeholder-image.png');

const aspectRatios = [
'1-1',
Expand Down Expand Up @@ -44,7 +44,7 @@ describe(`sbb-image`, () => {
html`<sbb-image
image-src=${imageUrl}
aspect-ratio="free"
style="width: 200px; height: 100px;"
style="--sbb-image-aspect-ratio: 10 / 1;"
></sbb-image>`,
);

Expand Down
6 changes: 4 additions & 2 deletions src/elements/lead-container/lead-container.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import '../link/block-link/block-link.js';
import '../title.js';
import './lead-container.js';

const leadImageUrl = import.meta.resolve('../core/testing/assets/lucerne.png');
const leadImageBase64 = await loadAssetAsBase64(leadImageUrl);
const leadImageUrl = import.meta.resolve('../core/testing/assets/placeholder-image.png');
const leadImageBase64 = await loadAssetAsBase64(
import.meta.resolve('../core/testing/assets/lucerne.png'),
);

describe(`sbb-lead-container`, () => {
const wrapperStyles = { backgroundColor: `var(--sbb-color-milk)`, padding: '0' };
Expand Down
2 changes: 1 addition & 1 deletion src/elements/message/message.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import './message.js';
import '../image.js';
import '../button/secondary-button.js';

const imageUrl = import.meta.resolve('../core/testing/assets/lucerne.png');
const imageUrl = import.meta.resolve('../core/testing/assets/placeholder-image.png');

describe(`sbb-message`, () => {
describeViewports({ viewports: ['zero', 'medium'] }, () => {
Expand Down

0 comments on commit f43db8d

Please sign in to comment.