-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add global for animations #76
add global for animations #76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but why don't use :global
, we usually use this syntax everywhere
Got it - #75 |
4bafb86
to
6c3a86b
Compare
There is an intresting question, we support syntax
This syntax is for declaration only, selector syntax remains the same |
I will finish this pr don't worry |
$unset: Infinity, | ||
$revert: Infinity, | ||
"$revert-layer": Infinity, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid creating variables every time, better performance
}; | ||
|
||
function localizeDeclaration(declaration, context) { | ||
const isAnimation = /animation(-name)?$/i.test(declaration.prop); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simlify logic for any animation declarations and avoid code duplication
node.type = "word"; | ||
node.value = node.nodes[0].value; | ||
|
||
return localizeDeclNode(node, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localize local()
in global mode so syntax works for all modes
if (node.value.toLowerCase() === "global" && node.nodes.length === 1) { | ||
node.type = "word"; | ||
node.value = node.nodes[0].value; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One place for our logic for global
add support for the
global()
function inanimation
andanimation-name
propertiesthe change modifies the
localizeDeclarationValues
function to handle theglobal()
function specifically for animation properties:This allows us to:
global()
usage in animation propertiesglobal()
wrapperExamples
Testing
Added test cases to verify:
global()
function works withanimation-name
propertyfixes #75