-
-
Notifications
You must be signed in to change notification settings - Fork 41
CssText
doesn't include text-shadow
's color if it's black
#97
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
Labels
Comments
Well, these are the default values, which are optional. So if you run: <body style="text-shadow: 2px 2px 2px">
The content of the body element is displayed in your browser.
</body> it looks the same as <body style="text-shadow: 2px 2px 2px black">
The content of the body element is displayed in your browser.
</body> The default ones are omitted when serializing - they don't add any value. |
FWIW, browsers seem to behave differently: var e = document.createElement("div");
e.innerHTML = '<span style="text-shadow: 2px 2px 0px black">test</span>';
e.firstElementChild.style.cssText
// -> "text-shadow: black 2px 2px 0px;" It's exactly the same in both Chrome and Firefox. This is identical in both browsers as well: e.innerHTML = '<span style="text-shadow: 2px 2px 0 #000">test</span>';
e.firstElementChild.style.cssText
// -> "text-shadow: rgb(0, 0, 0) 2px 2px 0px;" |
Yes, serialization is not part of the spec - but it does not matter much. |
FlorianRappl
added a commit
that referenced
this issue
Jan 6, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also, if you set the blur radius to 0px it will be omitted from
CssText
as well.The text was updated successfully, but these errors were encountered: