> Is this a joke?
> Of course it's a joke. Use semantic CSS class names.
But most of the time, designers don't know how to stick with a standardized padding and margin, so I find that without exception, an org requires me to develop "cryptic" representations of margin and padding, such as mr1 (margin right to 1 degree, or 5 px) or pl2 (padding left to 2 degrees, or 10px).
I've also rolled entirely new features without writing a single line of CSS. This is a way to mitigate CSS bloat. I take it you've never actually tried to deal with the problem of CSS bloat, or you'd find either 1) you'd have to hold a gun to designers' heads or 2) do exactly what I just showed you.
Usually a quick follow-up question will reveal the mistake and the designer is happy to make the correction.
This has been my best weapon against CSS bloat.
Which is worse; when it's done as satire, or seriously?
> Now that we’re writing almost all of our html in modular fashion, I have found mix-n-matching pre-defined css classes works the best. i.e. class=”inline-block bg-bbb text-333 padding-5-15″
http://penguindreams.org/blog/jekyll-3-and-foundation-6/
Adding "row-xx" or whatever to your HTML elements is basically going back to the garbage that was in table based html layouts.
View Raw
(Sorry about that, but we can’t show files that are this big right now.)
See also the latest reprinting of "A Modest Proposal," which kindly has "SATIRE -- DO NOT BELIEVE" in large caps on the front and back covers.
One of my favorite Asimov quotes is "It pays to be obvious, especially if you have a reputation for subtlety." It's a damn shame that it's helpful to put blaring giant signs that say SATIRE on it and ruin the joke a bit, but there's just a ton of people out there who just never really got up to speed on detecting it. Many - possibly most! - people really don't look that deeply into things and tend to take stuff at face value (or don't know that there is a deeper meaning to spot), no matter how outlandish.
All that as a mea culpa, as I read the OP's README and thought, "man, that seems like a bit of a mess... under what circumstances would you need to do that?" The answer is NO DO NOT DO THIS but I, lacking experience, kinda didn't get that right off the bat.
The top comment when I posted was a copypaste of the joke disclaimer. And the top reply to the top comment at the time of this posting is a copypaste of the joke disclaimer.
> Many - possibly most! - people really don't look that deeply into things and tend to take stuff at face value (or don't know that there is a deeper meaning to spot), no matter how outlandish.
If someone can't figure out why generating a CSS class for every (property, value) combination is funny, then I don't think an explanation will help. Maybe it will give those readers an A-ha! moment and a valuable life lesson, but it won't be funny for them.
> All that as a mea culpa, as I read the OP's README and thought, "man, that seems like a bit of a mess... under what circumstances would you need to do that?"
If you got rused then that's great. The joke did what it was supposed to do. What sucks is that people who instinctively click the comments first won't get that experience, because some killjoy had to post "IT'S A JOKE DON'T FALL FOR THIS."
Of course it's a joke. Use semantic CSS class names.
Here's the rational: http://mrmrs.io/writing/2016/03/24/scalable-css/
Not trolling, I think React is a fine framework.
1. Bootstrap is partly for prototypes and quick interfaces where front end best practices don't matter.
2. If you're using a preprocessor, you can include Bootstrap's classes and rename/combine them to something semantic.
3. Something can be a good idea when done in small quantities, and a terrible idea when taken to extremes.
I've had this happen a few times with other developers I thought were pretty sharp. The best example is when someone found Dogescript (https://dogescript.com/) and was convinced it was the next big thing. The best part was I didn't have the heart to tell him the truth.
How can someone take Dogescript seriously?! That is so retarded, even a guy witch is not into programmation and hang out on 9gag sometimes can tell it's a troll!:O
No, it is not the same as using "inline styles" (just think about it). Yes, it reduces CSS scope and bloat in styles sheets. Yes, it breaks the Separation of Concern principle. No, it does not create bloat in the markup. Yes, it forces you to style via markup rather than via a style sheet, etc.
Like with any other technique, choosing to use "Atomic CSS" in a project should be considered in relation to the problems authors have to solve. CSS is a complex matter, there is no one size-fit-all solution and there are not that many solutions either so I think we should think twice before disregarding a tool, any tool.
PS: Yes, I know universal.css is a joke but it is mocking a real/serious approach to big CSS problems.
Utility classes I dislike (mixins plx) and the idea of using important with them is not a design decision I would want to pick up.
I guess my bigger problem is that Harry sells himself as an expert, stands up on stage telling people this is how they should be doing things... and here I am, no book, no stage and my specificity level gets trumped by Harry amongst certain members of my team (despite my years of qualified awesomeness across large scale, popular, public domain sites)
Thought I'd just share that with you :`P
Utility classes don't belong everywhere but I think it's going a bit far to discredit the man for proposing this. His work on ITCSS in particular shows he's well versed in the language. I find this system far more sane than other proposals.
I come from an older thinking that your HTML should not have any classes that imply visual style, and that classes/id's should be semantic to the content and structure of the HTML.
CSSZen garden is a good example of this.
Nowadays I personally love semantic markup, stylistic mixins, and a CSS file linking the two together following BEM patterns.
I think legitimate times when this falls apart, is when I watch the designers I work with now, work in HTML & CSS - they need to quickly move things around, so doing this all from markup gives them a big speed increase, up until a point that is. We get involved now early after initial client direction sign-off to make their markup and CSS more robust before they carry on like a pig in poo.
The problem is having a class called .bold, and then baking it into your HTML. I feel like many people arguing this have never undertaken a full-scale visual redesign on a large site. The designer comes in, and all the sudden everything marked .bold ends up meaning "lightweight italicized text". This presentational/semantic cycle repeats every 6 years or so, but I'm not sure where it's heading.
I mean, nobody actually advocates translating every single possible style attribute into its own CSS class. But what's wrong with padding and margin utility classes that use a consistent set of widths? Is doing calculations on "1x" and "2x" when you want elements to line up really worse than doing calculations on pixel or em values in your CSS just because it's "unsemantic"?
Let's take the examples from the "maintainable CSS" book that's linked:
<!-- bad [sic] -->
<div class="red pull-left">
<div class="grid row">
<div class="col-xs-4">
<!-- good [sic] -->
<div class="header">
<div class="basket">
<div class="product">
<div class="searchResults">
Ask yourself, in which case can you read the code and tell roughly how it's going to render? In which case do you think you'll be able to re-use the classes on other pages? If you wanted to make another, visually consistent page that shows, say, seller search results instead of product ones, in which case do you think you'll be able to figure out which styles need to change more quickly?Here's the backend equivalent:
# "bad"
def cheapest_products_with_min_rating(rating)
products.
select { |p| p.rating >= rating }.
sort_by { |p| p.price }.
first(10)
end
# "good"
def products_for_category_landing_page(rating)
allowed = []
for p in products
if p.rating >= rating
allowed << p
end
end
# pretend I've implemented quicksort here
result = []
for p in sorted
break if result.length >= 10
result << p
end
result
end
Ugh, that first example - using all these "unsemantic" components like "sort" and "select"! How do I know when I look at the implementation of any of them, or the function itself, what the intent is? What business problem is being solved?The second example - so nice and "semantic". If we want to change what products show up on the category landing page, it will be easy!
...
In real life, nobody writes backend code like that. Why should we tolerate it in the frontend?
After all, who are we writing code for? - The end user? He can't care less about the class names. - Search engines? They can surely identify relevant content. Semantic classes help, but they don't rule out utilities. - Ourselves? I can read utility/semantic classes well especially that I've written. Also not a case against utilities.
I sympathize with the other commenters with my same problem.
To each their own, I guess.
Uh oh
whew, had me going there
What constitutes self-describing code is wildly different depending on the person. I mean, really?
EDIT: I definitely missed that this is a joke :'(
> Is this a joke? Of course it's a joke.
I have a lot of ideas for small side projects that could be good (or probably not, but at least I wanna try them seriously) and can't get time to implement them, and people who have this time waste it writing universal.css.
Oh, come on. It probably takes two hours, at most, to create a text generator that prints this whole universal.css file...
No thanks.
Honestly I thought bootstrap was the only css I would ever need, and this hasn't changed my mind.