Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. What are your CSS practices?

What are your CSS practices?

Scheduled Pinned Locked Moved The Lounge
csswpfcomdesigndocker
23 Posts 18 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Chris Maunder

    If you like Bootstrap you might also like [Semantic UI](https://semantic-ui.com/). I find their approach a little neater and more expressive.

    cheers Chris Maunder

    J Offline
    J Offline
    Jay Bardeleben
    wrote on last edited by
    #21

    It's appropriately named!

    1 Reply Last reply
    0
    • J Jay Bardeleben

      Quote:

      And for the CSS coding guidelines, I put everything on one line; I don't make it look like a programming function because CSS is not a programming language.

      Ha, I do and I don't. Generally depends on the project I'm working on and the mood I'm in where CSS is concerned as to whether they get the "one-liner" treatment or not. But in most cases if I'm defining something that has only 1 - 3 attributes, say for basic

      's, then they get put on one line. But if I need something more complex, such as adding gradients or something that needs a lot of attributes, I don't put them on one line (the minifier can deal with that one) because it's simply easier on my eyes to see what I'm doing (classic example - styling stupid form elements... :wtf: )

      p { ... }

      form { ... }
      ...
      input[type="blah"] {
      blah;
      blah;
      blaaaaaaah;
      }
      ...

      CSS can be a massive pain for sure, no one can ever deny that one (!!) and get way out of control all to easily, so I stick with a "standard" (more of a personal convention in reality) I've molded for myself over the years that works quite well for me and other's can easily grasp. Urg... haha. Lately though I've been leaving it all to Bulma or Bootstrap and run the other way so I can do the actual work I need to do and deal with it after, not gonna lie

      J Offline
      J Offline
      jgakenhe
      wrote on last edited by
      #22

      Yea, that is a good idea to add line breaks on complex styles. I'm old school CSS and followed Eric Meyer's style back in the early 2000's, though I do break up complex styles to a certain point. I compare it to SQL. I hate it when I have to fix someone else's select statement and it has 50+ attributes all on separate lines and I have to scroll up and down to just get to the tables.

      1 Reply Last reply
      0
      • C Chris Maunder

        You need to look at LESS or CASS. This lot would become

        div.main-menu {

        ...

        a { ... }

        div.sub-menu {

           ...
        
           a { ... }
        

        }
        }

        cheers Chris Maunder

        M Offline
        M Offline
        Member_14530480
        wrote on last edited by
        #23

        did you mean SASS by any chance?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups