5 ms·
Pretty good suggestions. Here are some thoughts that I had reading the article; * Suggestions are newly browser supported CSS properties in lieu of the earlier
by Brajeshwar 11y ago
Pretty good suggestions. Here are some thoughts that I had reading the article;
* Suggestions are newly browser supported CSS properties in lieu of the earlier ones. It is always easier to use new and improved ones than making it work on olden browsers.
* Most of them are also of how you should scaffold your styles and not necessarily the nitty-gritty of writing better CSS.
For instance, vertically centering a block element inside another block element can be done in various ways
* display:table, display:table-cell with a vertical-align: middle method for olden browsers is indeed of of those sure-shot method that works across a plethora of browsers.
* The translate method for newer browsers including IE10+ with some quirks.
* And of course, the Flexbox method, which is the current talk of the CSS town.
Well, centering in CSS has even spawn a whole industry - http://howtocenterincss.com/ http://howtocenterincss.com/.
Liked the idea of ":not()". This is something most developers overlooked.
The blanked statement and advice to 'use of SVG for icons' is something I can debate. This is not a binary statement/switch that you can make decision on. I'd rather decide on the method based on the requirement at hand and how it is being delivered. Even in dev-time, I do setup such that the team have to just drop in SVGs but eventually, a task runner takes care of the final icon set - be it as a @font-face - either served separately or BASE64 encoded with the styles (for something within a size budget that we set for the font-family).
I'd be pointing anyone wishing to improve holistically from a n00b to a better player would be to look at the likes of http://codeguide.co/ http://codeguide.co/, http://sass-guidelin.es/ http://sass-guidelin.es/ et al. And get http://caniuse.com/ http://caniuse.com/ hooked up in some way, either via your IDE or leave it open in a browser tab.
Edits: I thought Hackernews supported Markdown!
- Loque 11y agoOne thing to watch for when using :not() is that it has high specificity.
- myfonj 11y agoYup. More precise, it has the same specificity as the selector it is negating in its "parameter" (which must be a "simple" one, not compound). My favourite CSS bruteforce hack [1] for boosting specificity exploits this: *:not(#\0):not(#\0):not(#\0) {} /* three ID strong anything */ [1] Never used it in meaningful context, actually.