4 ms·
Oh my sweet summer child. As a pro having done this thing for decades, the industry standard in 2020 is to randomly throw margins, negative margins, and padding
by Saaster 7y ago
Oh my sweet summer child. As a pro having done this thing for decades, the industry standard in 2020 is to randomly throw margins, negative margins, and paddings on _everything_ (probably in JS/JSX) in the vicinity of the thing you're trying to position and visually iterate until things looks okay-ish. Probably by a dozen people simultaneously on the project, some of whom may have read an article on CSS once. After a year or two the whole thing is chucked out anyway. And that's all right, it gets the job done.
- 0xff00ffee 7y ago> randomly throw margins, negative margins, and paddings on _everything_ (probably in JS/JSX) in the vicinity of the thing you're trying to position and visually iterate until things looks okay-ish I wish this were not the case, but having researched the front page HTML of the 10 top trafficked websites during a new framework selection for a client, this is exactly how things are done.
- pestaa 7y agoWhat other things did you learn through this research, if I may ask?
- icedchai 7y agoThis made me crack up. I do this all the time and thought it was because I was "bad" at CSS, having not kept up with the times. Is there really no better way in 2020?
- hobofan 7y agoOf course there is a better way, but as he/she said most people don't know it. And for a lot of projects that are built to spec once, and maintained with minimal tweaks for a few years (traditional agency projects), the "bad" way is good enough. If you want a better way for a project that you will have to maintain for a longer time that should be more flexible, I would personally suggest something like BEM[0] + a few best practices (like the one suggested in the post). This will already get you a long way. [0]: http://getbem.com/ http://getbem.com/
- gentleman11 7y agoI rather like using BEM but have only used for 6 months or so on short projects. What is the “BEM considered harmful” article in 5 years going to say that we don’t know now?
- duhi88 7y agothere is, it just sometimes doesn't matter. Styling an important or often reused component? You best find a better way. Adding a tagline to a marketing site or temporary banner? Yea, do whatever you want to get the job done. Just don't let your whole site look like that or you'll have angry teammates.
- watwut 7y agoYou make it sound ironical and cynical, but that is actually how things are done in real world. I mean, I admit I have done that sort of thing after I read first article about css after someone required me to move something first time ...
- chrismarlow9 7y agoThis is reality (business) vs college (academic) lesson (and similar to the tired jokes about brushing off your algorithms books only for interviews). One time I asked a musician with a degree if I should go back to school for music. I was wondering if he thought it was worth the money and time. He said: "You can go learn all this stuff and you'll know everything about every song you hear. You'll understand all the underlying structures and how to write it out on paper. And music will become an entirely different thing to you. But guess what? You'll be broke, because that's not what people pay musicians for. They pay musicians to sound good and sell alcohol. All that other stuff only matters to people trying to pass their final."
- quotemstr 7y ago> As a pro having done this thing for decades, the industry standard in 2020 is to randomly throw margins, negative margins, and paddings on _everything_ (probably in JS/JSX) in the vicinity of the thing you're trying to position and visually iterate until things looks okay-ish. That's always been the industry standard though. It's a wonder the web works at all.
- pixelbash 7y agoDon't forget the occasional translateY for good measure!