DEV Community

Stephanie Eckles
Stephanie Eckles

Posted on

What is a problem you constantly have with CSS, or something you keep wanting to learn how to do?

No Peter Griffin operating blinds gifs allowed ;)

Top comments (60)

Collapse
 
ben profile image
Ben Halpern

I mostly have a hard time evolving with new paradigms. I just have a hard time wrapping my head around whether I should use the new stuff, the old stuff, etc.

Collapse
 
5t3ph profile image
Stephanie Eckles

For about 7 years I was working on projects with government contracts soooo thanks to having to support older IE I pushed off learning grid (for example) until the last few months :) I also spent that time essentially evolving with Bootstrap aka offloading the decision ;) What I love about modern CSS and advanced tooling is that you can accomplish a lot with a little. That said, even when you are familiar with both "old" and "new" there are always about 7 ways to accomplish the same thing, which is probably why CSS has some negative vibes. I love that part, it fuels my creativity :)

Collapse
 
alvaromontoro profile image
Alvaro Montoro

both is good

 
5t3ph profile image
Stephanie Eckles

Haha, alrighty:

Also be sure you understand the box model and the cascade. After that - practice! Get a Codepen account and even if it's just small works for your own benefit, your learnings can go with you anywhere! I also have a series (latest posts on my profile) called: "Modern CSS Solutions for Old CSS Problems" and I have a looot of posts planned for that :) Thanks for the encouragement, and best of luck to you!

Collapse
 
ender_minyard profile image
ender minyard • Edited

Making icons center next to text. I use emojis because it's easy. For example, if I wanted to make a button that said upload image πŸ–Ό and use a custom icon, the icon is never vertically centered. Oh look, even the emoji isn't centered.

Collapse
 
5t3ph profile image
Stephanie Eckles

Both grid and flexbox can be defined as an "inline" variant which is great for both buttons or text within a paragraph. I would recommend flexbox as the slight advantage since its default alignment is along the x-axis (horizontal).

Here's a possible solution for both button-looking links and inline links - you could swap the link to a span and update the class names:

Collapse
 
5t3ph profile image
Stephanie Eckles

In my role (frontend overseeing a design system impacting a large enterprise), I hear similar thinking a lot, but I'm passionate about frontend and helping others be successful! There are so many amazing resources to continue learning CSS, and it may mean taking a step back and approaching it with a beginner's mind. I have a series for beginners but two episodes evolve a blog layout and also a "card" layout. I specifically chose those because the blog shows how to begin managing general typography and content, and the card layout showcases properties for successful containers. A third episode covers expanding those to be responsive. I don't want this thread to become self promo, but DM me if you would like those links. The goal isn't necessarily to make it the prettiest but to make it functional, semantic, scalable, and accessible - principles you can appreciate from backend development, too :)

Collapse
 
anshulnegitc profile image
Anshul Negi

Problems I am facing in current projects are
Naming convention for that I am following BEM.
Being specific with units usability i.e for font size,letter spacing,line height,width, height etc..
Any thoughts on this?

Collapse
 
5t3ph profile image
Stephanie Eckles

Do you mean incorporating sizing into the BEM naming classes? It depends if you're going full-in on a completely utility library similar to Tailwind or if you're supplying a few classes for properties that enhance components in predictable ways, like elevation and spacing from Material.

Most sizing is a number that is either an arbitrary scale that says nothing obvious about the result, or is implied as a multiplier (like x * 8px for an 8px baseline grid) or involves some type of metaphor, the popular one being "t-shirt sizing" (xs, sm, md, lg, xl). And then there may be breakpoint modifiers thrown in depending on what the sizing is in relation to. They all have their place, but ultimately being sure to document and being consistent will help. You may want to do some comparison of existing frameworks and design systems. Viewing sizing in context of a mature component system may help identify what will work for your project. Good luck!

Collapse
 
anshulnegitc profile image
Anshul Negi

No that's not what I meant.
It's regqrding the units use px,vh,vw,rem,em etc.
For font size I can use px, rem, em but don't know why to choose particular unit.

Thread Thread
 
5t3ph profile image
Stephanie Eckles

Gotcha! Then the article I linked will provide some additional info on spacing for typography and other scenarios: Guide to CSS Units for Relative Spacing

Thread Thread
 
anshulnegitc profile image
Anshul Negi

Thanks

Collapse
 
dana94 profile image
Dana Ottaviani

I want to get better at creating pure CSS art that I see other devs make that blows my mind. I don't even know where to start with that though. I do check out their code on Codepen, but it gets a bit overwhelming at the sheer length of CSS I see.

Collapse
 
5t3ph profile image
Stephanie Eckles

Start small - it's ok if it's full of spans that just have background color applied :) You can work up your skills! Check out @ellie_html on twitter, she's doing CSS art for most of her #100DaysOfCode and she started with almost no CSS knowledge. A little every day will take you far!

I have just a couple like this pumpkin using CSS gradients - it took me a long time, then I made a snowglobe to work on it some more. Learning Sass and depending on what you're making an HTML preprocessor like Pug that can make it easier to generate duplicative HTML might be useful. But I have a lot to learn in that area too! Good luck!

Collapse
 
dana94 profile image
Dana Ottaviani

Thanks Stephanie!

I should mention I did attempt a CSS version of the Doctor's TARDIS. I'll definitely check out your work and start small next time!

distracted-jang-cfb752.netlify.app/

Thread Thread
 
5t3ph profile image
Stephanie Eckles

Nice work!!! It even vanishes, I love it!

Collapse
 
aaronktberry profile image
Aaron Berry

I never really know how to start if I have zero CSS in a project. How do I start structuring my CSS so my apps start looking a little more usable?

Collapse
 
5t3ph profile image
Stephanie Eckles

Typography and enhancing spacing between elements can take you a long way. You may also wish to include a reset such as Normalize. Then, choose a limited palette (to start) and experiment with adding color to improve hierarchy or help designate relationships between elements. Read up on accessible contrast as well. Here's an excellent Twitter thread from the creator of Tailwind CSS on little design tips to begin to improve your interface: twitter.com/i/events/8806882336418...

Collapse
 
chrisjabb21 profile image
Christopher Fouad Jabbour

I relate to this so much. I have to plan it out and just do it and just make the functionality and look good to.

Collapse
 
chiubaca profile image
Alex Chiu • Edited

I dont know if I should learn BEM or take the leap with something like tailwind

Collapse
 
tterb profile image
Brett Stevenson

I've really enjoyed using Tailwind in a few projects and once you get your tailwind.config all set up, I've found that it dramatically increases the speed and efficiency of my styling and formatting.

Collapse
 
5t3ph profile image
Stephanie Eckles

Even using a utility library you will find yourself with a need to compose reusable components. Learning how to name "components" of code is never a bad skill to pick up :) It helps in translating to a JS framework, or PHP files like for a WordPress theme, or communicating with coworkers and designers.

Collapse
 
chiubaca profile image
Alex Chiu

interesting, makes sense!

Collapse
 
arberbr profile image
Arber Braja

Naming classes :p

Putting jokes aside that is one of the hardest problems when it comes to programming, so no reason it should not be a problem on CSS.

No matter the tooling or setup you use, you still lose some time thinking about the naming convention to use.

Collapse
 
hadrianhughes profile image
Hadrian Hughes

box-shadow

Not even once.

Collapse
 
5t3ph profile image
Stephanie Eckles

haha! if you're a Chrome user, in the Inspector tools they provide a handy additional panel you can trigger to fine tune your results :) developers.google.com/web/tools/ch...

Collapse
 
hadrianhughes profile image
Hadrian Hughes

Very helpful! Thanks πŸ™‚