If you’re learning CSS or you’re experienced, you can get pigeonholed into the same routine. Since it’s comfortable and safe, knowing the pressure of working, you can stick to the same stuff over and over again. However, CSS is a language that’s constantly changing all the time.

As someone on a mission to improve their developer’s skills, I have been digging around and I have discovered so many useful things that have already boosted my skills and saved me a lot of time. To start, this is not a comprehensive list but just a few of the new things I have learned about.

Native nesting:

I’m sure you use SCSS and SASS for nesting selectors and like any sane or insane human being, you’re just sick of having to repeat the same lines over and over again:

eg

.mainBdyWrapper

.mainBdyWrapper .rightSide

.mainBdyWrapper .rightSide h2

Yes, you see the problem. Here is what you can do if you can’t use SASS or SCSS, or you just want to keep your CSS skills sharp:

.mainBdyWrapper{

&.rightSide{

& h2{

}

}

}

See? And it’s so easy!

This saves you lines and lines of code, so you don’t have to repeat yourself.

CSS Variables

Okay, I’m sure if you have coded, you know about variables, right? CSS has variables too.

Why use CSS variables? We think of it this way: imagine if you are creating a new page and you don’t want to type the same lines of code over and over again, especially with font names, colors, etc. This is where CSS variables come in!

Here is how you can use them:

:root{

-main-bg-color: brown;

}

then in the selector you just do this:

mainBdyWrapper{ background: var(--main-bg-color);; }

PS Dont ever use brown as a background color but SEE how easy it is?

Ok the third one is something i am just learnig about and

CSS Containers

Im sure yu use media queries a t but we are nw in the transitining phase where a t f native stuff in css is being impemented s keep yur eyes pe!

CSS cntainer queries are the new thing

<div class=”container”> <div class=”box”>Box 1</div> <div class=”box”>Box 2</div> </div>

Before you had to:

@media (max-width: 768px) { header { width: 80%; } }

Now you can just

header { @container (max-width: 768px) { width: 80%; } }

You can see how this saves you soo much time.

Mohammed Al Hashamy is a web developer with a focus on UX, ecommerce and startups. To connect with him https://twitter.com/MHashamy

Other Articles

Starting In Cloud Development Tips

Starting In Cloud Development Tips

Are you a beginner on cloud Development and want to start learning ? I have compiled some tips that will hopefully help you get started and look out for some common misconceptions: Sign up to courses for your chosen cloud platform Sign up to a free cloud trial. Most...

Setting Up Umbraco On A Local Machine

Setting Up Umbraco On A Local Machine

In this week’s article we will look at how to set up a fresh installation of Umbraco on your local machine. We will be create a v8.11.1 Umbraco installation and connecting it to a local SQL Server database. For this tutorial I will be working on a Windows machine as...

Fixing Git Merge Conflicts

Fixing Git Merge Conflicts

Git merge conflicts can be an absolute pain. Sometimes despite your best efforts you end up with conflicts when you create a Pull Request (PR) with your new feature. Just when you think you have finished with the current Product Backlog Item you have to go back and...