I need to use jStyleParser to create a tool that will split the CSS in multiple files based on the IE limitation of 4095 rules. So all i need is to load the CSS count and split it.
Will I have any issues with jStyleParser as will it drop any CSS from the original files that it doesn't recognise? (I've seen support for some :selectors has just been added to the master, so I assume it's not in the current version) Or it still keeps them?
Is jStyleParser right tool to do this with? (load css, count and split it, output it)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
jStyleParser should preserve all the syntactically correct CSS definitions. I.e. it should preserve even the unknown pseudo-classes but it will discard most CSS hacks and other garbage.
I mean for your purpose, some text processing tool would be more suitable (e.g. perl or awk on unix) unless you want to apply additional cleaning on your style sheets.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I really like jStyleParser as it's really easy and nice to use and I wouldn't trust regular expressions or such.
Another nice thing that I've noticed was that it also cleans the duplicated rules.
Could this "CSS hacks and other garbage." that gets discarded have any impact over the CSS as in affect the site, have different css from the input? Or it should be safe.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some webdesigners used to include "hacks" - intentional syntactical errors in the stylesheets that are normally ignored by most browsers but they are processed in a specific way by a particular target browser (most frequently older versions of Internet Explorer). The purpose is to force some specific definitions to a specific browser only. In that case, discarding the hacks could influence the rendering in the target browsers. However, in modern webdesign, this is not used too often now.
I would recommed to check your style sheets by some CSS validator and then test, how jStyleParser parses the potentially problematic parts shown by the validator.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to use jStyleParser to create a tool that will split the CSS in multiple files based on the IE limitation of 4095 rules. So all i need is to load the CSS count and split it.
Will I have any issues with jStyleParser as will it drop any CSS from the original files that it doesn't recognise? (I've seen support for some :selectors has just been added to the master, so I assume it's not in the current version) Or it still keeps them?
Is jStyleParser right tool to do this with? (load css, count and split it, output it)
jStyleParser should preserve all the syntactically correct CSS definitions. I.e. it should preserve even the unknown pseudo-classes but it will discard most CSS hacks and other garbage.
I mean for your purpose, some text processing tool would be more suitable (e.g. perl or awk on unix) unless you want to apply additional cleaning on your style sheets.
I really like jStyleParser as it's really easy and nice to use and I wouldn't trust regular expressions or such.
Another nice thing that I've noticed was that it also cleans the duplicated rules.
Could this "CSS hacks and other garbage." that gets discarded have any impact over the CSS as in affect the site, have different css from the input? Or it should be safe.
Some webdesigners used to include "hacks" - intentional syntactical errors in the stylesheets that are normally ignored by most browsers but they are processed in a specific way by a particular target browser (most frequently older versions of Internet Explorer). The purpose is to force some specific definitions to a specific browser only. In that case, discarding the hacks could influence the rendering in the target browsers. However, in modern webdesign, this is not used too often now.
I would recommed to check your style sheets by some CSS validator and then test, how jStyleParser parses the potentially problematic parts shown by the validator.