Lit: A ridiculously small responsive CSS framework
ajusa.github.io
ajusa.github.io
When I can get away with it, I'd rather use plain CSS.
This morning, I'm stripping out all of it and starting over from scratch, like I should have done in the first place.
A caveat is that I love their color system, so I'm importing and using that, but leaving out everything else.
EDIT: And the book by the same author, Refactoring UI, is also a fantastic primer on the philosophy behind Tailwind.
It was (and still) is zero. Maybe you have it mixed up with Tailwind UI? (which is a paid library of ready-made components built using TailwindCSS framework)
More specifically, the TextField component assumes an accompanying label, while none of the other form components do. It seems like a very odd choice to me, since all form elements should have a descriptive label.
The demo page for Checkbox (https://material-ui.com/components/checkboxes/) shows how to use them with labels, and also groups.
Agreed there should be something included for CheckboxWithLabel, but to think it's impossible and the whole thing must be thrown out is a bit much.
Also I'd suggest to anyone to potentially avoid using CSS vars if you're looking for enterprise browser support due to old IE. Obviously make your own decisions on this one but it I think 10 starts getting really weird with them...
All-in-all for the limited benefit this micro-lib brings I'd say go to something that's popular/supported vs. a project that hasn't seen a commit in 2 years.
Discussion: https://news.ycombinator.com/item?id=19593866
Isn't the whole point of a micro lib that it is limited in scope, well-designed, and shouldn't need to change much? I have my own libraries that see few commits as of late but still work fine
I haven't tried this yet, but in the author's defense the repo has no issues against it, so it's not like there is tangible proof that the author is neglecting maintenance or anything. Besides, the whole thing <500 lines of CSS - if it does what you need it to why go with anything that would be more complicated and more likely to break with an upgrade?
In the case of a CSS framework specifically, browsers are a moving target and you would expect changes to either fix issues or to take advantage of new features. 2018 is more than 10 versions of Chrome old, and while it's possible that nothing in that time was worth adding to this framework it does seem unlikely. At the very least you'd expect a line in a readme to be updated to say its been tested and it works.
More broadly for web dev though, the fact a feature isn't available in old browsers is a bad a reason not to use a new feature if it's useful and improves a site for the user. Obviously you shouldn't break your site in old browsers but progressively enhancing to take advantage of things is a very good thing. Browsers implemented @supports in CSS for precisely this reason.
Also how much support & udpates do you want to see in a piece of CSS that's barely a dozen blocks? It's a strange comment to make.
You can trivially process your css files through babel + postcss to support arbitrary browser targets. In this case, postcss will inline the vars letting write modern css while shipping css that works in old browsers.
1) the grid doesn't have gaps between columns. look at the form example, see how the two form field are right next to each other with no gap between them... that will cause a lot of headaches trying to layout even a slightly more complex form.
2) the naming of the colors in the util is inconsistent... they follow bootstrap with info, error, success, but then go with black, white, gray??? wtf is that. what about just sticking with the bootstrap naming and using dark, light, and default like they do. why switch when you already copied 80% of bootstrap's naming convention? makes no sense.
3) back to the grid. there are no viewpoint or reordering classes. do you know how much of a life saver it is to change the column order between devices with a simple order-md-2 in bootstrap. my god... if you ever had to do css trickery to move an element on mobile you see that the reordering in the grid is a god send.
https://getbootstrap.com/docs/4.0/layout/grid/#reordering
i'm sorry, but i personally see these micro frameworks as traps. bootstrap is very easy to recompile and strip out what you don't need to roll your own essentially.
Don't knock it till you try it! If you're generating HTML dynamically, define functions in code for your custom style classes which consist of a set of atomic styles provided by something like Tachyons.css. Then just call those in your template while rendering.
All the benefits of CSS variables and tooling like Sass/Less/etc. without the need for any special tooling!
Workflow under Tachyons: change html, reload page to see change, change html, reload, change html, reload, ....
Workflow under Sass/Less/etc.: change css, build css, (maybe) change html, reload, change css, build css, (maybe) change html, reload, ...
Most frameworks nowadays ship with Sass/Less built-in, or at the very least make it trivial to bolt it on. Further, most frameworks nowadays fully support the ability to automatically rebuild stylesheets when regenerating the HTML, in which case it's quite literally: change CSS, reload, change CSS, reload, etc. The build times are negligible (especially if I'm using Erlang/Elixir or C# or something else that needs compilation on changes anyway).
Also, since I'm in the habit of keeping the HTML I write or generate concerned solely with describing the content rather than the appearance thereof, there's rarely (if ever) a separate "change HTML" step there; the HTML (or the templates to generate it) is already written alongside the content, and it's just a matter of adding enough CSS to make it look decent.
Importantly, since the HTML makes no assumptions about its appearance, it's straightforward to define different stylesheets for different contexts (whether interactive v. print, or reusing a given page on multiple sites/applications with very different styles, or what have you).
YMMV, but probably if you are building, say, a standard "boring" CRUD application and you need to get it out quickly you can get a lot of mileage out of Bootstrap or similar frameworks. There is a ton of work already done for you with things like accessibility and browser compatibility, and while these kinds of sites are a bit samey, that is also a plus in that users don't face a learning curve - a menu or calendar widget will behave like every other menu or calendar widget they've seen. An off the shelf theme or some SASS variable tweaking can provide enough branding differentials.
On the other hand if you have very demanding customers/designers who require everything to be pixel perfect and "popping" then something like Tailwind that gives you more low level flexibility with some sensible defaults might be a better fit (honestly though, with these kinds of clients you're probably going to have to mess around with CSS anyway).
.\31{width:5%}
.\33{width:22%}
.\34{width:30%}
.\35{width:40%}
.\32{width:15%}
huh? can you tell me what those \31 \33 etc. mean? .1{width:5%}
.3{width:22%}
.4{width:30%}
.5{width:40%}
.2{width:15%}
It's an escape sequence that lets you have non-alphabetic characters to start a CSS selector. See this for more examples:Probably a workaround for a CSS grammar issue that makes ".1{…}" not parse correctly?
<div class="35">
this stackoverflow answer has more info (looks like you can use any symbol you want, even spaces and [{}<>&*] !): https://stackoverflow.com/a/27882887/5534735 chr(0x35) == '\x35' == '5'
so the actual usage would be <div class="5"> <form action="docs/lit.html">
<button class="mt1 btn primary white bold" type="submit">Get Started</button>
</form>Only aware of https://kognise.github.io/water.css/