Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9258821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:30:18+00:00 2026-06-18T12:30:18+00:00

I find that a lot of my time while writing css is wasted on

  • 0

I find that a lot of my time while writing css is wasted on locating the right place to put new rules. For example, if I have this stylesheet:

.a, .b, #c {
  display:inline-block;
}

.d {
  color: #fff;
}

And I want to add .d {display:inline-block;), I’ll often think for a sec about whether I should add this to the 1st or 2nd section. Meaning:

.a, .b, #c, .d {
  display:inline-block;
}

vs

.d {
  color: #fff;
  display:inline-block;
}

Obviously as CSS gets more complicated, there is more time wasted on this. Another time consumer is the process of locating existing rules in order to edit them, when the selector appears several time in the stylesheet.

Is there a specific workflow / tool that can make the CSS writing process faster and more efficient?


Please Note:

  1. A similar question already exists, but it was answered two years ago, so an up-to-date answer is required

  2. As a relatively new SO user I wasn’t sure whether this belongs here or on Programmers. If this is off-topic on SO I’ll be happy to migrate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:30:19+00:00Added an answer on June 18, 2026 at 12:30 pm

    I ran into this problem a few years back and like you, I noticed that whenever I was working with large CSS files (say… 1000+ lines), that most of the time was spent looking up specific selectors, more so than editing or writing specific rules.

    Because of that, I have a few conventions I follow that probably made working with CSS files 10x easier for me. The key is to realize that the bottleneck in your workflow is looking up selectors, so the key is to make this process easier.

    1. Write your CSS selectors in the order as they appear in your HTML mark up. More often than not, we start writing styles by looking at our mark up first (via inspect element, etc.) so when you write your selectors in the order of your markup, you have a rough idea for where to look for the rules in your CSS file.

      Thus, for your example code, the answer depends if you are sacrificing the organization for code reuse. Sure, you might be able to reuse code if you keep things in the same selector (i.e. .a, .b, .c, .d), but are you making the selector impossible for you to find when you revisit your CSS 6 months later? Use your judgement.

    2. Write styles on a single line. Unless there’s some good reason you can’t write this way (e.g. you’re using a CSS preprocessor where you have to nest your rules, you work with an existing codebase maintained by 10 other developers, etc.), writing styles on a single line helps you find styles MUCH faster. For example, writing like:

      selector { property1: value, property2: value; property3: value; }
      selector2 { property1: value, property2: value; property3: value; }
      selector3 { property1: value, property2: value; property3: value; }
      

      Instead of:

      selector { 
        property1: value, 
        property2: value; 
        property3: value; 
      }
      
      selector2 { 
        property1: value,
        property2: value;
        property3: value;
      }
      
      selector3 { 
        property1: value,
        property2: value;
        property3: value;
      }
      

      Writing rules on a single line allows you to SCAN selectors. Plus, you can easily reduce a CSS file with 1000+ lines to 10 times fewer that amount, which makes it much more manageable. Again, remember that te bottleneck in our workflow is looking up selectors. So while writing the “traditional” way makes reading properties easier, it actually slows down the process for looking up selectors. What’s more, if you write selectors in a single line, you can then use indentations like this:

      header { property1: value, property2: value; property3: value; }
        header h1 { property1: value, property2: value; property3: value; }
        header h3 { property1: value, property2: value; property3: value; }
        header h3 span { property1: value, property2: value; property3: value; }
      body { property1: value, property2: value; property3: value; }
      
    3. Find and replace is your bread and butter. If you organize your selectors using the two suggestions above, often finding selectors for major sections can lead you close enough to find the specific rules that you need. For example, if you’re trying to find something ultra specific like #someDiv header ui li a:hover and you can just do a search for #someDiv and that would lead you close enough to find the rest.

    Hope that helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I find that if there are a lot of classes the compilation time is
I find that writing web apps and WinForm apps generally come out a lot
While profiling an app, realise that quite a lot of time (37%) is spent
I'm doing something like zgrep somepattern access_log.X.gz But I find that a lot of
On DBPedia you can find a lot of URIs that containing double underscores and
There's a lot of software that will take a search string and find all
In an application that I'm writing I have to load a lot of data
Seems that lot of people already know that issue but I can not find
I'm writing a fairly simple 2D multiplayer-over-network game. Right now, I find it nearly
I spend a lot of time offline, and while normally I'm in the middle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.