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
{{ message }}
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.
Hey @andreinitescu, thanks for the input. We thought about it too. But finally decided with a custom CSS parser.
Besides the obvious server side css parsing benefits, here are our reasons for not to use CSSOM:
Browser compatibility issues. Even on MDN page, they retrained to include a table due to many incompatibilities across different browser vendors
CSSOM requires you to actually put css into the page in order to get underlying object. While there are hacky methods to implement a usual interface to this hack, still doing a normal parsing seemed better.
CSS syntax is rather easy to parse.
But you are right, if we have programmatic direct access to browser's internal css parser, that would be way better.
Thank you Kemal.
I'm mostly worried about first one, compatibility across browsers.
Do you have any more info regarding that, any quick example which comes to your mind?
In order to parse CSS by CSSOM using a <style> element , I see the CSSOM objects and properties required are LinkStyle.sheet, CSSStyleSheet.cssRules, CSSStyleRule.style, CSSStyleDeclaration, which all seem from DOM Level 2 specification.
But maybe I'm missing something.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For client side, any specific reason not to just use CSSOM?
http://jsfiddle.net/v2JsZ/
The text was updated successfully, but these errors were encountered: