doc/dev/coding_standards_css.rst
author Denis Laxalde <denis.laxalde@logilab.fr>
Thu, 21 Mar 2019 14:33:54 +0100
changeset 12530 9d88e1177c35
parent 12370 b3084ae2e718
permissions -rw-r--r--
Remove Twisted web server Twisted web server is not used anymore and has been superseded by pyramid many years ago. Furthermore, our usage is not compatible with Python 3. So we drop the "etwist" sub-package. As a consequence, "all-in-one" configuration type gets dropped as it was Twisted-specific. We resurrect it in cubicweb/pyramid/config.py by only keeping options used by the "pyramid". Similarly, we introduce a AllInOneCreateHandler in cubicweb/pyramid/pyramidctl.py that is basically the one that lived in cubicweb/etwist/twctl.py and is used to create the "all-in-one" instance. Added a TODO here about "pyramid.ini" that could be generated at the end of bootstrap() method. In cubicweb/devtools/httptest.py, CubicWebServerTC is now equivalent to CubicWebWsgiTC and the latter is dropped.
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
~~~~~~~~~~~~~~~~~
12370
b3084ae2e718 [doc] translate french to english
Laurent Peuch <cortex@worlddomination.be>
parents: 10492
diff changeset
    10
b3084ae2e718 [doc] translate french to english
Laurent Peuch <cortex@worlddomination.be>
parents: 10492
diff changeset
    11
- 2 spaces before properties
6049
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    12
12370
b3084ae2e718 [doc] translate french to english
Laurent Peuch <cortex@worlddomination.be>
parents: 10492
diff changeset
    13
- no space before ":", one space after
6049
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    14
12370
b3084ae2e718 [doc] translate french to english
Laurent Peuch <cortex@worlddomination.be>
parents: 10492
diff changeset
    15
- only one space between values of the same property
6049
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
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    18
Documentation
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    19
~~~~~~~~~~~~~
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    20
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
    21
what they are for.
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    22
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    23
Recommendation
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    24
~~~~~~~~~~~~~~
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    25
- 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
    26
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    27
- 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
    28
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    29
- Think about later customization by application
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    30
f0ae98fa85a1 [doc] started js/css coding standards
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    31
- 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
    32
  framework doesn't include packing functionalities