Opened 4 years ago

Closed 4 years ago

#3158 closed change (fixed)

Add CSS and HTML rules to coding style page

Reported by: saroyanm Assignee:
Priority: P3 Milestone:
Module: Websites Keywords:
Cc: greiner, fhd, trev Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29329899/

Description (last modified by greiner)

Background

In coding style page CSS and HTML rules are missing, which leads to redundant dispute during code reviews.

What to change

Add rules below as coding style for HTML and CSS:

  • Follow the Google HTML/CSS Style Guide.
  • Use double over single quotation marks.
  • Don't omit optional HTML tags.
  • CSS color values should be specified in hexadecimal where possible.
  • CSS shorthand properties usage is optional.
  • CSS rule declaration order should follow the WordPress CSS Coding Standards.
  • CSS number values should specify units where possible.
  • CSS number values between -1 and 1 should specify a leading 0.

Change History (8)

comment:1 Changed 4 years ago by saroyanm

  • Description modified (diff)

comment:2 follow-up: Changed 4 years ago by fhd

I think we should change Use hexadecimal values for colors where possible to CSS color values should be specified in hexadecimal where possible for clarity.

comment:3 in reply to: ↑ 2 Changed 4 years ago by saroyanm

  • Description modified (diff)

Replying to fhd:

I think we should change Use hexadecimal values for colors where possible to CSS color values should be specified in hexadecimal where possible for clarity.

Done

comment:4 Changed 4 years ago by saroyanm

  • Description modified (diff)

During one of the review we have noticed that having shorthand property usage as requirement is not a good idea while we can't inherit property with shorthand and probably there could be cases when we need to inherit.

comment:5 Changed 4 years ago by greiner

  • Description modified (diff)

comment:6 Changed 4 years ago by saroyanm

  • Ready set

I think we can already have this rules online, if no objections.
Anyway we can always update the rules IMO.

comment:7 Changed 4 years ago by saroyanm

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:8 Changed 4 years ago by saroyanm

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.