fix(curriculum): use mediaText for CSSHelp (#42393)
* fix(curriculum): use mediaText in CSSHelp prevent selection of style elements with class or media attributes this should avoid picking up some browser extensions
This commit is contained in:
@ -37,14 +37,14 @@ You should declare a `@media` query for devices with a `height` less than or equ
|
||||
|
||||
```js
|
||||
const media = new __helpers.CSSHelp(document).getCSSRules('media');
|
||||
assert(media.some(x => x.conditionText?.includes('(max-height: 800px)')));
|
||||
assert(media.some(x => x.media?.mediaText?.includes('(max-height: 800px)')));
|
||||
```
|
||||
|
||||
Your `p` element should have a `font-size` of `10px` when the device `height` is less than or equal to `800px`.
|
||||
|
||||
```js
|
||||
const rules = new __helpers.CSSHelp(document).getRuleListsWithinMedia('(max-height: 800px)');
|
||||
assert(rules?.find(x => x.selectorText === 'p')?.style.fontSize === "10px");
|
||||
assert(rules?.find(x => x.selectorText === 'p')?.style?.fontSize === "10px");
|
||||
```
|
||||
|
||||
Your `p` element should have an initial `font-size` of `20px` when the device `height` is more than `800px`.
|
||||
|
Reference in New Issue
Block a user