You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got stylesheets that I do not want the polyfill to process. For instance, my project's main stylesheet, and an auxiliary stylesheet with a media attribute for conditional loading. These each have a couple of odd and end rules in it that have properties like inset: auto; or top: 0;, so the polyfill is processing them and generating custom properties for them, even though I know for a fact that these rules will never be relevant to anything I am using anchor positioning with. I want to avoid the re-rendering caused by this, but I would rather not sequester those odd couple of rules into separate stylesheets, they are rather happy just where they are 😄
What I would like to see is a configuration option that puts the polyfill into "opt-in mode", by allowing me to specify an attribute name so that only stylesheets with that attribute name will be processed.
// Still accept the single boolean argument for compatibility:
polyfill(true);
// Also accept an object argument...
polyfill({
updateAnchorOnAnimationFrame: true
});
// ... and add the new option to the object argument for "opt-in mode".
polyfill({
optInAttribute: 'data-polyfill-anchor'
});
// Also allow a global variable to specify the object argument.
window.ANCHOR_POSITIONING_POLYFILL_OPTIONS = {
updateAnchorOnAnimationFrame: true,
optInAttribute: 'data-polyfill-anchor'
};
Let me know what y'all think
The text was updated successfully, but these errors were encountered:
I've got stylesheets that I do not want the polyfill to process. For instance, my project's main stylesheet, and an auxiliary stylesheet with a
media
attribute for conditional loading. These each have a couple of odd and end rules in it that have properties likeinset: auto;
ortop: 0;
, so the polyfill is processing them and generating custom properties for them, even though I know for a fact that these rules will never be relevant to anything I am using anchor positioning with. I want to avoid the re-rendering caused by this, but I would rather not sequester those odd couple of rules into separate stylesheets, they are rather happy just where they are 😄What I would like to see is a configuration option that puts the polyfill into "opt-in mode", by allowing me to specify an attribute name so that only stylesheets with that attribute name will be processed.
Let me know what y'all think
The text was updated successfully, but these errors were encountered: