Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-157780 Update based on design audit #826

Merged
merged 5 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions acrobat/blocks/prompt-card/prompt-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
display: inline-flex
}

.prompt-toast:before {

Check failure on line 39 in acrobat/blocks/prompt-card/prompt-card.css

View workflow job for this annotation

GitHub Actions / runner / stylelint (18.x)

[stylelint] reported by reviewdog 🐶 Expected double colon pseudo-element notation Raw Output: message:"Expected double colon pseudo-element notation" location:{path:"/home/runner/work/dc/dc/acrobat/blocks/prompt-card/prompt-card.css" range:{start:{line:39 column:14}}} severity:ERROR source:{name:"stylelint" url:"https://stylelint.io/"} code:{value:"selector-pseudo-element-colon-notation"}
background: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI2ZmZiI+PHBhdGggZD0iTTEwIDE4Ljc1Yy00LjgyNSAwLTguNzUtMy45MjUtOC43NS04Ljc1UzUuMTc1IDEuMjUgMTAgMS4yNXM4Ljc1IDMuOTI1IDguNzUgOC43NS0zLjkyNSA4Ljc1LTguNzUgOC43NVptMC0xNkE3LjI1OCA3LjI1OCAwIDAgMCAyLjc1IDEwYzAgMy45OTggMy4yNTIgNy4yNSA3LjI1IDcuMjVzNy4yNS0zLjI1MiA3LjI1LTcuMjVTMTMuOTk4IDIuNzUgMTAgMi43NVoiLz48cGF0aCBkPSJNOS4xODMgMTMuOTQzYS43NTEuNzUxIDAgMCAxLS41NTgtLjI0OGwtMi42NDMtMi45NGEuNzUuNzUgMCAwIDEgMS4xMTUtMS4wMDNsMi4wMjYgMi4yNTQgMy43LTUuMDQ2YS43NS43NSAwIDEgMSAxLjIwOS44ODdsLTQuMjQ1IDUuNzlhLjc0NS43NDUgMCAwIDEtLjU2Ny4zMDVsLS4wMzcuMDAxWiIvPjwvZz48L3N2Zz4=");
background-repeat: no-repeat;
background-size: contain;
Expand Down Expand Up @@ -69,14 +69,14 @@
flex: 1 0 0;
flex-direction: column;
justify-content: space-between;
padding: 20px 20px 24px;
padding: 16px 16px 24px;
transition-delay: 3s;
transition-property: border;
max-width: 276px;
}

.prompt-blade:hover {
box-shadow: 3px 6px 6px 0 rgba(0, 0, 0, .16)
box-shadow: 0 3px 6px rgba(0, 0, 0, 16%)

Check failure on line 79 in acrobat/blocks/prompt-card/prompt-card.css

View workflow job for this annotation

GitHub Actions / runner / stylelint (18.x)

[stylelint] reported by reviewdog 🐶 Expected modern color-function notation Raw Output: message:"Expected modern color-function notation" location:{path:"/home/runner/work/dc/dc/acrobat/blocks/prompt-card/prompt-card.css" range:{start:{line:79 column:25}}} severity:ERROR source:{name:"stylelint" url:"https://stylelint.io/"} code:{value:"color-function-notation"}
}

.prompt-blade:active {
Expand Down Expand Up @@ -119,7 +119,7 @@
border-top-left-radius: 8px;
border-top-right-radius: 8px;
color: #696969;
display: -webkit-box;

Check failure on line 122 in acrobat/blocks/prompt-card/prompt-card.css

View workflow job for this annotation

GitHub Actions / runner / stylelint (18.x)

[stylelint] reported by reviewdog 🐶 Unexpected vendor-prefix "-webkit-box" Raw Output: message:"Unexpected vendor-prefix \"-webkit-box\"" location:{path:"/home/runner/work/dc/dc/acrobat/blocks/prompt-card/prompt-card.css" range:{start:{line:122 column:12}}} severity:ERROR source:{name:"stylelint" url:"https://stylelint.io/"} code:{value:"value-no-vendor-prefix"}
flex: 1 0 0;
font-family: "Adobe Clean", adobe-clean, "Trebuchet MS", sans-serif;
font-size: 20px;
Expand Down Expand Up @@ -153,10 +153,10 @@
font-style: normal;
font-weight: 400;
line-height: 150%;
padding: 2px 8px
padding: 2px 16px
}

.prompt-copy-btn:after {

Check failure on line 159 in acrobat/blocks/prompt-card/prompt-card.css

View workflow job for this annotation

GitHub Actions / runner / stylelint (18.x)

[stylelint] reported by reviewdog 🐶 Expected double colon pseudo-element notation Raw Output: message:"Expected double colon pseudo-element notation" location:{path:"/home/runner/work/dc/dc/acrobat/blocks/prompt-card/prompt-card.css" range:{start:{line:159 column:17}}} severity:ERROR source:{name:"stylelint" url:"https://stylelint.io/"} code:{value:"selector-pseudo-element-colon-notation"}
background: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzI0MjQyNCI+PHBhdGggZD0iTTE2Ljc1IDExLjVoLS41YS4yNS4yNSAwIDAgMC0uMjUuMjV2LjVjMCAuMTM4LjExMi4yNS4yNS4yNWguNWEuMjUuMjUgMCAwIDAgLjI1LS4yNXYtLjVhLjI1LjI1IDAgMCAwLS4yNS0uMjVaTTE2Ljc1IDkuNWgtLjVhLjI1LjI1IDAgMCAwLS4yNS4yNXYuNWMwIC4xMzguMTEyLjI1LjI1LjI1aC41YS4yNS4yNSAwIDAgMCAuMjUtLjI1di0uNWEuMjUuMjUgMCAwIDAtLjI1LS4yNVpNMTYuNzUgNy41aC0uNWEuMjUuMjUgMCAwIDAtLjI1LjI1di41YzAgLjEzOC4xMTIuMjUuMjUuMjVoLjVhLjI1LjI1IDAgMCAwIC4yNS0uMjV2LS41YS4yNS4yNSAwIDAgMC0uMjUtLjI1Wk0xNi43NSA1LjVoLS41YS4yNS4yNSAwIDAgMC0uMjUuMjV2LjVjMCAuMTM4LjExMi4yNS4yNS4yNWguNWEuMjUuMjUgMCAwIDAgLjI1LS4yNXY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yNWguNWEuMjUuMjUgMCAwIDAgLjI1LS4yNXYtLjVhLjI1LjI1IDAgMCAwLS4yNS0uMjVaTTE0Ljc1IDExLjVoLS41YS4yNS4yNSAwIDAgMC0uMjUuMjV2LjVjMCAuMTM4LjExMi4yNS4yNS4yNWguNWEuMjUuMjUgMCAwIDAgLjI1LS4yNXYtLjVhLjI1LjI1IDAgMCAwLS4yNS0uMjVaIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01IDYuNUgxLjVBLjUuNSAwIDAgMCAxIDd2MTBhLjUuNSAwIDAgMCAuNS41aDEwYS41LjUgMCAwIDAgLjUtLjV2LTMuNUg1LjVBLjUuNSAwIDAgMSA1IDEzVjYuNVoiLz48L2c+PC9zdmc+");
background-repeat: no-repeat;
background-size: contain;
Expand Down
2 changes: 1 addition & 1 deletion acrobat/blocks/prompt-card/prompt-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function createBlocks(element, blockArray, templateCfg) {
}
element.remove();

if (templateCfg.rows && parentNode.classList.contains('section')) {
if (templateCfg?.rows && parentNode.classList.contains('section')) {
const resizeObserver = new ResizeObserver(() => {
const computedStyle = window.getComputedStyle(parentNode);
if (/^(\d+(\.\d+)?(px|fr|em|rem|%))( (\d+(\.\d+)?(px|fr|em|rem|%)))*$/.test(computedStyle.gridTemplateColumns)) {
Expand Down
7 changes: 4 additions & 3 deletions test/scripts/scripts-preloads.test.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { expect } from '@esm-bundle/chai';
import { waitForElement } from '../helpers/waitfor.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'waitForElement' is defined but never used.


describe('Test scripts.js configurable preloads', () => {
it('has preload metadata', async () => {
document.head.innerHTML = '<link rel="icon" href="data:,"><meta name="preloads" content="$MILOLIBS/blocks/marquee/marquee.js,$MILOLIBS/blocks/marquee/marquee.css,https://www.example.com/abc.js"/>';
document.body.innerHTML = '<main><div class="marquee"></main>';
await import('../../acrobat/scripts/scripts.js');
const js = document.querySelector('link[rel="preload"][href="https://main--milo--adobecom.hlx.page/libs/blocks/marquee/marquee.js"]');
const css = document.querySelector('link[rel="stylesheet"][href="https://main--milo--adobecom.hlx.page/libs/blocks/marquee/marquee.css"]');
const js = document.querySelector('link[rel="preload"][href="https://main--milo--adobecom.hlx.live/libs/blocks/marquee/marquee.js"]');
const css = document.querySelector('link[rel="stylesheet"][href="https://main--milo--adobecom.hlx.live/libs/blocks/marquee/marquee.css"]');
const other = document.querySelector('link[rel="preload"][href="https://www.example.com/abc.js"]');
const acrobatcss = document.querySelector('link[rel="stylesheet"][href="/acrobat/styles/styles.css"]');
const milocss = document.querySelector('link[rel="stylesheet"][href="https://main--milo--adobecom.hlx.page/libs/styles/styles.css"]');
const milocss = document.querySelector('link[rel="stylesheet"][href="https://main--milo--adobecom.hlx.live/libs/styles/styles.css"]');
expect(js).not.to.be.null;
expect(css).not.to.be.null;
expect(other).not.to.be.null;
Expand Down
Loading