-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(font-size): gather style declaration of type Attributes #9414
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.
I suppose this LGTM!
Definitely a bit weird that the font-size audit result is identical whether we identify the style source or not, maybe that should change :)
|
||
result = FontSizeGather.getEffectiveFontRule({attributesStyle, inherited}); | ||
expect(result).toMatchObject({type: 'Attributes'}); | ||
|
||
result = FontSizeGather.getEffectiveFontRule({matchedCSSRules, inherited}); |
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.
want to throw attributesStyle
in here to test the correct specificity?
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.
done
In either the also |
fair points, I'm sold :) |
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.
LGTM!
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.
LGTM
Attributes
is a type forcssRule
in thefont-size
artifact.The audit checks for it here.
However, the gatherer never returned a rule of type
Attributes
. Instead, it was returning nocssRule
(that property is optional) - which was fine because the audit handles it in the same way.First thought was to just remove
Attributes
from the type property. But then I saw it was pretty simple to change the gatherer to be correct.But ... it doesn't really convey much more information - just makes it more explicit - so I could go either way with this. The style declaration will look like this:
Also: I think this was the only reason
cssRule
was made optional - or is there another valid reason that it would not exist?