1 @title CSS Coding Standards
4 This document describes CSS features and coding standards for Phabricator.
8 This document describes technical and style guidelines for writing CSS in
11 Phabricator has a limited CSS preprocessor. This document describes the features
16 You should put all `z-index` rules in `z-index.css`, and keep them sorted. The
17 goal is to make indexes relatively manageable and reduce the escalation of the
18 Great Z-Index War where all indexes grow without bound in an endless arms race.
22 Phabricator's preprocessor provides some standard color variables. You can
23 reference these with `{$color}`. For example:
30 You can find a list of all available colors in the **UIExamples** application.
34 If you preface a rule with `!print`, it will be transformed into a print rule
35 and activated when the user is printing the page or viewing a printable version
43 Specifically, this directive causes two copies of the rule to be written out.
44 The output will look something like this:
57 The former will activate when users look at the printable versions of pages, by
58 adding `__print__` to the URI. The latter will be activated in print contexts
63 Phabricator's environment defines several device classes which can be used to
64 adjust behavior responsively. In particular:
68 /* Smallest breakpoint, usually for phones. */
72 /* Middle breakpoint, usually for tablets. */
76 /* Largest breakpoint, usually for desktops. */
79 Since many rules are specific to handheld devices, the `.device` class selects
80 either tablets or phones:
84 /* Phone or tablet (not desktop). */
89 Phabricator's CSS preprocessor automatically inlines images which are less than
90 32KB using `data:` URIs. This is primarily useful for gradients or textures
91 which are small and difficult to sprite.