CSS => Too Complicated 😡

I'm a Web-Developer for about 4 years now and I love every aspect of it except for CSS. Don't get me wrong I do like CSS because it has so many possibilities. But that is kind of the problem. I'm currently building my own website and I'm struggling on how to setup my CSS. I'm developing all native but I was thinking switching to Bootstrap or something because designing isn't my specialty. I wanna start my CSS from zero so that all user agent styles are gone for my website but I also want to keep my CSS as little as possible. My head is currently exploding right now because I'm wasting time with this overcomplicated and stupid CSS language. Summary: I just want an easy and effective way to write CSS code without any issues with user agent styles and responsiveness.
42 Replies
CodeMoon07
CodeMoon07OP23h ago
@Kevin Powell Now I don't know if its ok to tag you and if not I'm sorry but I really wanted you to see that as well.
13eck
13eck23h ago
Don’t start your CSS from zero. Most of the defaults are well-thought out and work. There’s no reason to remove them. Indeed, there are many gotcha’s that you’ll run into if you try. Instead, adopt an additive approach: when you find something you don’t like, add a rule to change it. Use classes and descendant selectors liberally so you don’t run into specificity issues that frequently. And, when you feel like you need to add !important it’s time to reevaluate your CSS and find out where the bug is and fix it. Also, #📝rules 5️⃣ : no pinging Kevin (or mods) with questions
CodeMoon07
CodeMoon07OP23h ago
your right Kevin also said in one of his videos that you should work with the browser and not against it but im worrying about that some user agent styles might ruin my site
ἔρως
ἔρως23h ago
you cant stop that from happening just make sure it is accessible everything that the users do is out of your control, so, dont even think about it
13eck
13eck23h ago
Don’t worry about what the end user does. You can’t stop them from doing anything. Only worry about what you do. Do your best. If the want to need things up that’s their problem
CodeMoon07
CodeMoon07OP23h ago
i was thinking about building my own framework starting with the hard reset with: * { all: unset; } but im not sure how long it takes to setup most stuff again and what important rules i might forget to add back
ἔρως
ἔρως23h ago
N nNO nono
13eck
13eck23h ago
Don’t. That way lies madness
ἔρως
ἔρως23h ago
that is like taking a rocket launcher and obliterating your house with you inside
13eck
13eck23h ago
The only people who should be doing that are experts in design and the web. And that is a very few number of people indeed
CodeMoon07
CodeMoon07OP23h ago
💀
ἔρως
ἔρως23h ago
seriously, dont do it
13eck
13eck23h ago
Use the default styles until you have a good reason to override
CodeMoon07
CodeMoon07OP23h ago
so you guys say i should just write minimal css code working with the defaults and not against
13eck
13eck23h ago
YES
ἔρως
ἔρως23h ago
we didnt say minimal, but yed
CodeMoon07
CodeMoon07OP23h ago
if yes then should i style include a box model reset with margin and padding etc none
ἔρως
ἔρως23h ago
no that's like putting mines on your house and dancing around
CodeMoon07
CodeMoon07OP23h ago
cmon man that cant be too harsh its just preventing layout defaults
ἔρως
ἔρως23h ago
some elements will stop working properly if you do that for example, lists will have all sorts of issues
CodeMoon07
CodeMoon07OP23h ago
wait lemme show you an example * { margin: 0; padding: 0; border: 0; } *, *::before, *::after { box-sizing: border-box; } your telling me thats bad
ἔρως
ἔρως23h ago
the defaults for "layout" is no margin or padding
13eck
13eck23h ago
The top is BAD. The bottom is good
CodeMoon07
CodeMoon07OP23h ago
dayum
ἔρως
ἔρως23h ago
but you are doing the reset for EVERYTHING
13eck
13eck23h ago
Why? What benefit does this provide? Hint: none
ἔρως
ἔρως23h ago
if you want to make it worse, add outline: none then it's trully cursed...
13eck
13eck23h ago
Change things when you need to, ands there is literally no need to nuke padding/maring on everything
CodeMoon07
CodeMoon07OP23h ago
guess what i did that in my early stages of css including other random stuff in the universal selector
13eck
13eck23h ago
Advise the browser, don’t micromanage it
ἔρως
ἔρως23h ago
that is horrible
CodeMoon07
CodeMoon07OP23h ago
like resize both and overflow auto on EVERYTHING dont ask me why
ἔρως
ἔρως23h ago
... cursed
CodeMoon07
CodeMoon07OP23h ago
ik
ἔρως
ἔρως23h ago
at least you didnt put the font-size to 62.5%
CodeMoon07
CodeMoon07OP23h ago
yh wdym
13eck
13eck23h ago
To go back to the topic as-written. CSS isn’t too complicated. You’re overcomplicating it
ἔρως
ἔρως23h ago
if you have to delete a default, you better have a very good reason for it
CodeMoon07
CodeMoon07OP23h ago
lemme find some old bad CSS code from me for fun
ἔρως
ἔρως23h ago
there are some defaults you will want to change, like the width of inputs, the font of textareas and the margin around the body but if you nuke everything, you will add everything back, probably with the same exact values
CodeMoon07
CodeMoon07OP23h ago
OH NAH I FOUND A CURSED EXAMPLE * { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, Arial, Helvetica, tahoma, Verdana, sans-serif, monospace; outline: none; border: none; appearance: none; user-select: none; overflow: hidden; letter-spacing: 0.5px; } body { width: 100vw; height: 100vh; display: grid; place-items: center; overflow: auto; } that aswell @ἔρως
ἔρως
ἔρως23h ago
that is cursed indeed

Did you find this page helpful?