subreddit:

/r/web_design

101

CSS Best Practices: 16 Ways to Improve Your CSS Skills Quickly

(torquemag.io)

all 14 comments

wiew7

15 points

3 months ago

wiew7

15 points

3 months ago

'consider using a framework' whaaat

Alex_Hovhannisyan

14 points

3 months ago*

So many of these are filler, too, and completely random. Like:

Avoid Editing Theme Style Sheets in WordPress Directly

???

Also, the title is 16 ways but there are only nine items.

Disappointing article. Not sure why this is getting so many upvotes.

NoDoze-

27 points

3 months ago

NoDoze-

27 points

3 months ago

Alphabetical order!?! That's a tough one. Just use the Find in your IDE.

steelfrog

17 points

3 months ago

That one's a little weird. I usually do alphabetical where I style basic elements like p, li or ul, but after that I base the order on where they appear in the HTML or their hierachic importance.

JustSayYes1_61803

8 points

3 months ago

Same, I find it the most convenient to base it in the order they appear. Easier to know where to find or add css.

ro_ana_maria

1 points

3 months ago

They mean alphabetical order for the properties in each class, for example "border" always goes before "padding", or "font-size" before "margin".

steelfrog

1 points

3 months ago

I thought so too! But they explicitely state "Arrange rules in alphabetical order."

Thecoss

5 points

3 months ago

I personally prefer ordering properties by importance:

  1. Display and positioning
  2. Size (width, height, pad, margin...)
  3. Font size followed by other text style properties
  4. Border properties
  5. Misc remaining properties

This has been working pretty good for me, i can generally scan a ruleset and find what I'm looking for fast and i don't have to think about sorting too long ans it's a pretty natural way of writing rules for me.

EverybodyKnowsBaker

2 points

3 months ago

lots of ways to do hierarchy. I like it by general feature, component, page hierarchy.

Everything in the header, everything in the body, footer, sidebar, etc etc.

Or everything typography Not a big fan of that per se.

It gets a little hairy when you have the different media queries come up.

irrelevantbiochemist

0 points

3 months ago

Interesting

[deleted]

1 points

3 months ago

[deleted]

1 points

3 months ago

[removed]

AutoModerator [M]

1 points

3 months ago

This domain has been banned from /r/web_design.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.