Skip to content

Commit

Permalink
Merge pull request #826 from adobecom/promptcard
Browse files Browse the repository at this point in the history
MWPW-157780 Update based on design audit
  • Loading branch information
TsayAdobe committed Sep 27, 2024
2 parents f0bdb54 + 73baf4b commit 07a5da4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
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 @@ -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%)
}

.prompt-blade:active {
Expand Down Expand Up @@ -153,7 +153,7 @@
font-style: normal;
font-weight: 400;
line-height: 150%;
padding: 2px 8px
padding: 2px 16px
}

.prompt-copy-btn:after {
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';

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

0 comments on commit 07a5da4

Please sign in to comment.