4 ms·
In this case, I too have to question the NPM / Bower (yes, it's optional, but IMHO shouldn't be needed). The CSS file is basic flexbox. I think it would be a bi
by soundwave106 11y ago
In this case, I too have to question the NPM / Bower (yes, it's optional, but IMHO shouldn't be needed). The CSS file is basic flexbox. I think it would be a bit embarrassing if you were a web developer, and had to npm / bower a library to avoid writing trivial flexbox CSS.
This isn't a complicated, full featured grid... those definitely need dependency management.
If you are new to flexbox, the CSS file is a helpful demonstration I guess. Flexbox is way more powerful, and far more flexible, than this grid alone though.
- joshmanders 11y ago> I think it would be a bit embarrassing if you were a web developer, and had to npm / bower a library to avoid writing trivial flexbox CSS. Why does everything have to be this huge library to be used? Why can't I pull in 30 small libs that composed? I'm a Node.js developer, our ecosystem is built around small focused modules that do one thing and one thing well. Sometimes you can write the 1 line yourself, or pull in a module and know that if anything changes that could affect that line of code, someone somewhere will notice it before you and update the module. Congratulations you just saved yourself hours of debugging because someone else did it for you.
- soundwave106 11y agoLibraries always are a trade-off between the flexibility of developing it yourself versus the time saved relying on other people's work. To me, it's less the size of the code than the functionality that matters. Code size is not necessarily an indicator of how hard it is to solve a problem after all. In this case, however, we are talking about pretty basic CSS. There are some standards for page layout, but there is no One True Way to design a web page front end... all designs are different. Small CSS like this (as a library) in effect make design decisions for you and I don't think CSS is difficult enough for this to be justified. As an example (without manually editing the CSS at least, which defeats the point of the NPM / Bower installs), this grid CSS locks you in to arbitrary divisions of 12. What if your grid requires 5 evenly spaced columns? You can't do that.
- joshmanders 11y ago> I don't think CSS is difficult enough for this to be justified. YOU don't think it is. Neither does my buddy who works in CSS/SASS, but I do. Because I don't do styling. I'm mostly a backend developer. > What if your grid requires 5 evenly spaced columns? You can't do that. I just did it easily by 5 elements and putting them as `-fill`. 5 evenly spaced columns. I wouldn't have been able to do that without this lib because I don't know CSS that well, nor flexbox. This library just saved me tons of time, just to do what you said it can't.
- supermatt 11y agoIts still a case of copypasta, and is reminiscent of the cowboy PHP development prevalent during the early 00s. Granted, in this case the library is exceptionally lightweight, but its still a 3rd party dependency and should be treated as such. It still gets injected into the codebase at the end of the day, and can be vendored if required.