doc/coding_standards_css.rst
author Rémi Cardona <remi.cardona@logilab.fr>
Wed, 20 May 2015 15:12:58 +0200
changeset 10427 7677c0401864
parent 6049 f0ae98fa85a1
permissions -rw-r--r--
[devtools] qunit: update to 1.18.0 (closes #5533333) * the logging API has changed (register callbacks instead of setting attributes on the QUnit object) * the logging callbacks all have a single "details" object argument * the "main" div was renamed to "qunit-fixture" (this change is responsible for all the churn in our own JS test files) * QUnit can now build the DOM elements it needs for reporting from a single "qunit" div
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6049
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     1
CSS Coding Standards
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     2
--------------------
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     3
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     4
(Draft, to be continued)
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     5
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     6
:Naming: camelCase
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     7
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     8
Indentation rules
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     9
~~~~~~~~~~~~~~~~~
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    10
- 2 espaces avant les propriétés
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    11
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    12
- pas d'espace avant les ":", un espace après
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    13
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    14
- 1 seul espace entre les différentes valeurs pour une même propriété
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    15
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    16
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    17
Documentation
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    18
~~~~~~~~~~~~~
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    19
Please keep rules semantically linked grouped together, with a comment about
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    20
what they are for.
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    21
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    22
Recommendation
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    23
~~~~~~~~~~~~~~
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    24
- Try to use existing classes rather than introduce new ones
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    25
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    26
- Keep things as simple as possible while in the framework
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    27
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    28
- Think about later customization by application
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    29
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    30
- Avoid introducing a new CSS file for a few lines of CSS, at least while the
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    31
  framework doesn't include packing functionalities
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    32
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    33