GAUD-8854: Make offscreen styles node safe#7199
Conversation
|
Thanks for the PR! 🎉 We've deployed an automatic preview for this PR - you can see your changes here:
Note The build needs to finish before your changes are deployed. |
There was a problem hiding this comment.
I am just curious why you decided to move the code into its own file. Is there something special that made you did that ?
There was a problem hiding this comment.
It's so that they can be imported in a Node environment without also registering the <d2l-offscreen> web component. customElements.define won't be defined in Node.
There was a problem hiding this comment.
Oh I didn´t expanded the existing file so I didn't see the web component. That makes total sense! nice!
| import { css } from 'lit'; | ||
| import { getFlag } from '../../helpers/flags.js'; | ||
|
|
||
| const OffSCREEN_SIZELESS = getFlag('d2l-offscreen-sizeless', true); |
There was a problem hiding this comment.
Just an FYI, the flag will be always-true when this is called from Node.
There was a problem hiding this comment.
Yep, I added HAS_DOCUMENT as a guard to default to 1px(as if the flag was off). I'll make a separate PR to remove that guard and just use 0 when the flag is removed
|
🎉 This PR is included in version 3.270.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
GAUD-8854
BSI needs to import these styles,
documentandcustomElementswon't allow it.