made media-quary's tests lenient (#45969)

This commit is contained in:
Muhammed Mustafa 2022-05-16 10:42:45 +02:00 committed by GitHub
parent d285d9964e
commit 57edd03eb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 6 deletions

View File

@ -116,7 +116,9 @@ assert(!!el && el.target === '_blank')
Your portfolio should use at least one media query.
```js
assert.isAtLeast(new __helpers.CSSHelp(document).getCSSRules('media')?.length, 1);
const htmlSourceAttr = Array.from(document.querySelectorAll('source')).map(el => el.getAttribute('media'))
const cssCheck = new __helpers.CSSHelp(document).getCSSRules('media')
assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
```
Your `#navbar` element should always be at the top of the viewport.

View File

@ -213,7 +213,9 @@ assert(!!el && top1 >= -15 && top1 <= 15 && top2 >= -15 && top2 <= 15)
Your Product Landing Page should use at least one media query
```js
assert.isAtLeast(new __helpers.CSSHelp(document).getCSSRules('media')?.length, 1);
const htmlSourceAttr = Array.from(document.querySelectorAll('source')).map(el => el.getAttribute('media'))
const cssCheck = new __helpers.CSSHelp(document).getCSSRules('media')
assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
```
Your Product Landing Page should use CSS Flexbox at least once

View File

@ -222,7 +222,9 @@ assert(!!el && left1 >= -15 && left1 <= 15 && left2 >= -15 && left2 <= 15)
Your Technical Documentation project should use at least one media query
```js
assert.isAtLeast(new __helpers.CSSHelp(document).getCSSRules('media')?.length, 1);
const htmlSourceAttr = Array.from(document.querySelectorAll('source')).map(el => el.getAttribute('media'))
const cssCheck = new __helpers.CSSHelp(document).getCSSRules('media')
assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
```
# --seed--

View File

@ -116,7 +116,9 @@ assert(!!el && el.target === '_blank')
Your portfolio should use at least one media query.
```js
assert.isAtLeast(new __helpers.CSSHelp(document).getCSSRules('media')?.length, 1);
const htmlSourceAttr = Array.from(document.querySelectorAll('source')).map(el => el.getAttribute('media'))
const cssCheck = new __helpers.CSSHelp(document).getCSSRules('media')
assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
```
Your `#navbar` element should always be at the top of the viewport.

View File

@ -213,7 +213,9 @@ assert(!!el && top1 >= -15 && top1 <= 15 && top2 >= -15 && top2 <= 15)
Your Product Landing Page should use at least one media query.
```js
assert.isAtLeast(new __helpers.CSSHelp(document).getCSSRules('media')?.length, 1);
const htmlSourceAttr = Array.from(document.querySelectorAll('source')).map(el => el.getAttribute('media'))
const cssCheck = new __helpers.CSSHelp(document).getCSSRules('media')
assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
```
Your Product Landing Page should use CSS Flexbox at least once.

View File

@ -222,7 +222,9 @@ assert(!!el && left1 >= -15 && left1 <= 15 && left2 >= -15 && left2 <= 15)
Your Technical Documentation project should use at least one media query.
```js
assert.isAtLeast(new __helpers.CSSHelp(document).getCSSRules('media')?.length, 1);
const htmlSourceAttr = Array.from(document.querySelectorAll('source')).map(el => el.getAttribute('media'))
const cssCheck = new __helpers.CSSHelp(document).getCSSRules('media')
assert(cssCheck.length > 0 || htmlSourceAttr.length > 0);
```
# --seed--