Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "css flexbox"
-
Just before you, my fellow system programmer, scroll past this, let me say this:
🍬 The web is actiually simple. 🍬
Both HTML and CSS is declarative. It's all easy when you understand the concepts, learn how to be idiomatic and quit trying to do that imperative bullshit in languages that aren't imperative.
HTML is simple. You know the boilerplate: doctype, head, body, that's all. Just mark it up and do NOT look at it before you end, mark it up as it were article or something. The appearance is up to css.
CSS is simple. You may even forget bem or rscss, you're already a skilled software developer. Use common sense and your code-splitting and naming skills you gained reading The Code Complete or doing software development for years.
Forget mockups. Forget absolute positioning, forget setting width and height in pixels. Go to awwwards, find some inspiration. Draw some buttons and fields on paper with your good old pencil. Then go and write some css. Feel free to steal some shadows and transitions from codepen.
Read about 8-pixel grid system. Let every element push away from others by setting something like margin: 16px; and whoops! You've just got fully responsive and got great vertical rhythm without even using media queries!
Oh my god, do NEVER set width and height explicitly! Type something like button { width: 120px; } and bang! The entire web page is broken. Quit that shit. Let it resize as it should. It will resize itself to fit its contents.
HTML is by default ready for your template engine. That's how you receive data from server — as server-side rendered, plain old HTML page. On the other hand, the form element is the most axiomatic and simple way to send the data to server. That's how you send it — as plain old GET or POST that every webserver can handle.
All of there are true:
1. It's easy to get great 100% responsiveness without media queries.
2. It's easy to align items in row, it's just one line of css. Maybe two, if you still want elements to wrap, but want to use flexbox:
.parent {
display: flex;
flex-wrap: wrap;
}
3. HTML and CSS are fast by default.
4. You don't need mockups to achieve great visual experience. Mockups is imperative, web is declarative.
5. You may not even need JavaScript to make great website.
Go on, ask me a question about web! I'll ready to answer everything.21 -
Okay so even at my advance 52 years of age, I still pull all nighters to handle emergency remediation projects, and clean up other peoples messes. I don't mind, I'm a geek, I get high on the challenge of fixing shit that is broken all to hell.
But tonight was different. Tonight has me raging.
I am tasked with renovating a website, and building a sister site to that main site as well. no bother, I haven't done any web dev in 15 years but I'll power through pulling 18 to 20 hours a day for a couple of weeks to get in the groove...
Little did I know... CSS is a pain in the ass to be sure, but FLEXBOX is total and complete bullshit.
I don't give to shits about all the fancy shit it can do, it can't do simple shit worth a damn. Fuck Flexbox, and anyone involved in producing that useless layout model.
The sheer number of idiots promoting that hunk of shit a solution that is to be applied to any task other than wiping my ass is astounding.
Fuck all you jerk offs out there posting your shitty mark up turds as if they are gold, when you know better than anyone it works, sometimes, then doesn't, and is so easy to break it may as well be called "Web Design Jenga".
I'm still tired as hell, and tomorrow I will go back to slogging through CSS as the layout method, but at least I feel a little better now.
Oh and before I forget FUCK YOU FLEXBOX you piece of shit.14 -
Fuck all these CSS frameworks using Jquery as their dependency. Cross-browser my ass.
I am going full flexbox.2 -
To anybody that didn't look through the entire chrome dev summit (lucky you and I don't blame you for it) - some very interesting gamified resources for css grid, service workers and flexbox:
- https://www.gridcritters.com/
- https://serviceworkies.com/
- https://mastery.games/p/...2 -
Completed Flexbox Froggy.
Finally Learned FlexBox , would recommend it 100%.
From: flexboxfroggy.com12 -
FUCK SAFARI!!!!! I am developing our new company website and have a deadline tomorrow. It is built with flexbox WHICH SHOULD WORK EVERYWHERE BY NOW. The new website works FINALLY GREAT in all browsers now and then I just tested it in Safari (which I did not do before) on my mac and SO MANY THInGs doNT WORK! WHATTA FCUK?? I EVEN GOT EVERY THING TO WORK IN EDGE?? Is safari the new explorer?! What happened?!4
-
Tl;DR; version:
French designer, Mexican PSD -> HTML converter, Indian VueJS developer, Spanish project manager and a Taiwanese back-end developer. Application was made like an tower of pizza from bullcrap held by boogers and constantly licked by an orangutang to keep it standing.
Longer version:
We had to take a "half-finished" project from one of our clients, received the code for full-stack project. The css/design was so unbearable that it mostly broke on anything that had higher than 720px wide screen, structure was full of tables/divs and no fucking flexbox/grid... Then the fun part - we saw it's conversion to vueJS - a single fucken App.vue file that had shitton of conditions for pages.... yea, not even multi-component/routed app, just conditions!!!! And then... A back-end (in which I mainly specify myself) - it was made by a developer that had to mainly use Java/C# as their daily driver while all being build on php and Laravel. 0 Fucken laravel functions used, 0 of models, logic and so on.... Most of the page was running on RAW sql queries. Names... Oh my god the function names....
`getTheUsersThatHasAtLeastOneSpaceAssignedToThemByGivenCompanyId(int $id)`
And it held an RAW sql that was coming from a model....
All of this was managed by a random spanish manager who couldn't really understand what our client needed and what he actually wanted so from 100% of the site, only 20% was correct in logic....
And yet, according to the whole "package" (team) - they did everything correctly, saw no issues and our client was ungrateful fucker that refused to pay 10x the amount that we asked in order to completely re-do the application....
Morale: Remote teams are great... As long as all of them can work remote in TEAM.5 -
I dont fucking care if you dont like CSS Grid or flexbox Im not going to fucking CHANGE THE FUCKING ENTIRE LAYOUT.11
-
Flexbox.. Where have you been all these years?!
When I initially started learning web development I remember thinking 'someone didn't quite think this through..' about centering block elements etc in the dom. Those days are now over, I still believe in miracles.6 -
Damn, CSS Grid and Flex are fucking awesome!
I've been using both at least a year now and with a handful of SCSS mixins they have made the never-ending misery of front-end bearable.
Before I was forced to use Bootcrap floating grid and it was just a fucking mess and in some cases made JS hacks necessary.4 -
I love web development and web design. You can make something custom that looks great in a short period of time. Use the many frameworks to your advantage.
Also, for the people hating css, i get it. It's har sometimes but it's not that bad. Flexbox makes your life waaay easier.5 -
Flex + CSS grids is awesome. I know I am late. I regret not realizing this earlier. Way earlier.
Someone who does not agree with me please read this: https://css-tricks.com/snippets/...4 -
so, flexbox.
and my only question is: why did it take CSS 30 years to get the features which it should have had from the start? now because of that, even this awesome thing is messy due to how the old features collide (or don't collide, i'm not entirely sure tbh) with it.
but maan, flexbox! now at least a part of css feels like a tool made to solve the problem it's supposed to solve, instead of layers of hacks that you can somehow hack into having the side effects which result in it doing what you want it to do!7 -
I don't understand why people use Float in CSS. I love to use Flexbox I think I use them too even.
For example:
I want to write some text.. Flexbox
I want to add a image and some text below... Hum Flexbox!!
So I can consider myself a Flexbox.14 -
If some of you front-end devs haven't used CSS-Grid yet and are still annoyed by using nasty position and JS hacks to place stuff, I strongly recommend you to take 1-2 hours and read this incredibly useful guide for CSS-Grid:
https://css-tricks.com/snippets/...
and this one for Flex:
https://css-tricks.com/snippets/...
These two links have saved me PLENTY of hours struggling with all kinds of responsiveness and placement/sizing issues.1 -
I thought I had a decent handle on CSS. I can use flexbox and grid to make some decent and responsive webpages, and I'm at least familiar with most of CSS's more common gotchas
But no.
Even in 2021, with years of improvement in the language and browser compatibility, CSS can still fuck you over
I was adding some margin to a div element, and I noticed that the div element's margin seemed to force it's parent to move down too, as if the margin was applied to the parent as well
It took far too many nearly nonsensical google searches to discover that CSS has a nasty little trick called 'margin collapse'
And in true CSS fashion, the way to fix it is a hacky workaround. In this case, if you add a padding of 1px to the parent, the margin collapse doesn't apply.
Fuck CSS. From its weird implementation to its hundreds of gotchas to its hacky workarounds to said gotchas.
Fuck CSS2 -
After CSS Grid and Flexbox, I don't see the need for frameworks (except for utilities like margin and padding).
Change my mind 🙂4 -
I fucking hate vendor prefixes. HATE.
Got some nice JS code? Well it's about to get ugly 'cause in our browser, the API needs some special name treatment or it feels offended.
Got some nice CSS?
You're welcome, it just grew 3x in size because "ugh, I ain't havin' the same flexbox as lousy Chrome over there! I'm special, I'm -ms-!"
Fucking bullshit.1 -
That feeling when you, after a day of struggeling with that fucking front-end shit that is CSS and the alignment hell it brings, stumble upon a post about flexbox...2
-
As a strong supporter of ditching anything other than pure css for layout, finding out flutter has an equivalent of flex box is making my private parts flex-grow: 20;1
-
Spent a couple of hours trying to figure out why my flexbox css wasn't rendering as suspected. Finally discovered that the html tag I tried to apply it to didn't support display: flex;
Gah.3 -
Is it good time to switch to CSS Grid Layout frameworks such as Blueprint CSS? How is good/bad as compared to Flexbox?6
-
Chrome it's shit. I have been brainstorming in the CSS on a flexbox and its height of 100%.
My website works under Firefox.
The code to win tonight.
And you? You use which browser?15 -
It's CSS quick maffs time! Consider the following code:
<div class='container flex'>
<nav class='menu flex'>
<a href='#'>Menu item 1</a>
(arbitrary amount of links)
</nav>
<button type='button'>Sign in</button>
</div>
You want the layout to look like a horizontally scrolling, single line menu with a Sign in button to the right. Both container and menu are flex containers. So, here's the code for the menu:
.menu {
overflow: auto;
}
The problem is, as there is no flex-wrap, menu will not be wrapped, and it will occupy all the space it's needed to accommodate all the elements, breaking its container. Pesky horizontal scroll appears on the whole body.
Boubas will set menu's width to some fixed value like 800px, and this is a bouba approach because bye-bye responsiveness.
Here's what you should do:
.menu {
overflow: auto;
min-width: 0;
}
.menu * {
flex-shrink: 0;
}
This way, menu will occupy exactly the width of an empty div. In flexbox, its width will be equal to all free space that is not occupied by the Sign in button. Setting flex-shrink is needed for items to preserve their original width. We don't care about making those items narrower on narrower screens, because we now have infinite amount of horizontal real estate. Pure, inherent responsiveness achieved without filthy media queries, yay!
The menu will scroll horizontally just like you wanted.
aight bye14 -
UX and Game Design: "Keep It Simple" Is Stupid.
Presentation, Content, and Structure
Often when designing a UI, I stumble across blogs and articles that discuss it and focus far too much on the structure. Wordpress is terribly guilty of this and I see it fairly often in the game industry.
In web design you might use flexbox for a content-centric design and not worry too much about the layout, or css grid if structure seems important. But the broader question is why? Why is structure important and why is it wrong to focus on structure over content?
First, structure *comes* from content. Even where over many years, we've taken certain kinds of content, be they the various genres of games, or the sundry type of websites or apps, we've learned to take all the various patterns and categorize them, to extract the commonly repeating idioms into what we call structure.
But if you're experienced, and a fan of UI design in general, then I bet you that you can name a number of counter-examples, those that broke the mould, or broke the 'rules' of good design and still somehow worked. And that follows *because* structure is derived from content. This is the same reason idioms, patterns, and best practices change over time, as we codify exceptions into their "own" rules, new best practices emerge which mostly everyone follows, and then yet more exceptions break them. And so it goes.
So we see content before structure. But isn't there something to be said of style? Why yes, there is.
To read the full article, all 14k words of it, head over to medium for more:
https://swcs.medium.com/ux-and-game...5 -
Just spent 30 mins vertically centering a damn image in a two-column Bootstrap row. Yeah, flexbox is great unless you want to stack the columns at mobile screen size like they do with Bootstrap normally. Then everything breaks and the original ugly hack just gets replaced by a slightly lesser evil.
I really hope that we sort this out somehow before colonising Mars.5 -
On the newer side of web development. Using CSS Grid with some flexbox. Any idea on why my 768px media query styles are overwriting my 320px styles?
I was breaking into modules but moved everything to a single css file until I figure out what causes the issue. The mobile styles are at top and I started the medium breakpoint below the initial styles.
Designed it mobile first if that makes a difference. Should the media queries be nested?13 -
To all who use CSS:
Do you vertically align using flexbox or some weird old hacky method? I just used flexbox throughout a personal project to find out it doesn't work on my mom's computer...
Sorry if this question is too serious for this, but it really bothers me :D12 -
CSS.... vertical centering back around 2000 before flexbox and frameworks
HTML- before we head css frameworks looked bootstrap. I am done make things pretty ..I make them functional -
DAMN SHITTY MCFUCKFACE CSS FLEXBOX FUCKSYFUCK.
"Let's make this flexbox thing as unreliable as flexy".
My ASS. -
Sometimes I find solutions so ridiculous, I can't help but laugh at the hours that I put into finding them.
I tried to find a way to put space between items in a flexbox while they were in a row, but without leaving uneven space on either side of the elements when they wrap. After scratching my head for longer than I'd like to admit, giving the parent a negative margin and the children the same positive value allowed me to achieve this. (I would have saved a lot of time googling this, I know.) -
CSS, I particularly don't hate it but i don't love it either. As a React developer I love JS but I don't really like CSS based UI development i mean it's not bad but just level of satisfaction i get with a running logical thing in JS vs creating some UI stuff with CSS does varies. So I want to improve my CSS skills. Anyway can anyone suggest in what topic order I should learn CSS, I can do some basic stuff with flexbox and sometimes with grid but I think I lack some essential concepts.
-
Any recomendations of CSS framework? I'm currently looking at Bulma (for some reason Vue tutorials are using it a lot), but lacks a little bit in documentation.
What I'm looking:
- Minimal size
- Responsive
- Flexbox based
- Not material (please)
- Without annoying dependencies (OPTIONAL)
- Good or some documentation7 -
You have just learned flexbox and how to arrange things in CSS. You can use flexbox without even looking at your notes or the web.
And suddenly you saw a tv displaying a web app which show a que number with off-grid looking style with small scrolling(not sized properly inside viewable area i.e 100% vh )
The OCD start.... Or your spider sense is tingling wanting to make the correction...haha1 -
How the HELL someone develops a 'NEW' (essentially table layouts from the '90s) way of building layout with CSS and delivers this massive dump?
Why can't I make a div expand to fill the remainder space in this layout?
https://stackblitz.com/edit/...
Seriously... I need to wrap 10 divs inside each other to make a design behave correctly really like in the 90s? And the new kids on the block think this 'flexbox' is any good? Amazing sheeple... amazing. ADD MORE WRAPPERS!
align-self should JUST WORK in the example above... but hey... it does not.
I just want to be able to add/remove the sidebar and content, keeping the footer below and headers above.
It's amazing the ammount of shims required to do anything in development on the frontend.5