DevTools/CSSTips: Difference between revisions

Jump to navigation Jump to search
Updating page to be more accurate with latest code base
(→‎Content or Theme CSS: no more *stripe)
(Updating page to be more accurate with latest code base)
Line 1: Line 1:
To make Dao's life easier (and optimize our reviews), make sure that your code follows these rules:
This page is for information about CSS used by the DevTools toolbox.  Wondering about the Dev Edition theme?  See this page for more information about the [https://wiki.mozilla.org/DevTools/Developer_Edition_Theme Developer Edition theme]


== Basics ==
== Basics ==
First, you can find existing DevTools CSS at https://dxr.mozilla.org/mozilla-central/source/browser/themes/shared.  Here are some basic tips that can optimize reviews if you are changing CSS.


* Split your CSS into theme and content files (see below)
* Split your CSS into theme and content files (see below)
* Make sure your theme code is present for the 3 platforms, and that files are referenced twice in Windows' jar.mn (once for XP, once for Vista/7) So to add foo.css, your patch should include:
** 3 added files: <tt>/browser/themes/[gnome|pin|win]stripe/browser/devtools/foo.css</tt>
** 4 changes to the 3 files: <tt>/browser/themes/[gnome|pin|win]stripe/browser/jar.mn</tt>
* Avoid <tt>!important</tt> but if you have to use it, make sure it's obvious why you're using it (maybe with a comment)
* Avoid <tt>!important</tt> but if you have to use it, make sure it's obvious why you're using it (maybe with a comment)
* Avoid magic numbers, prefer automatic sizing
* Avoid magic numbers, prefer automatic sizing
Line 18: Line 17:
=== Testing ===
=== Testing ===


CSS changes should be tested visually on:
CSS changes to the toolbox should generally be similar across platforms since they used a shared implementation, but there can still be differences worth checking out.  Check major changes on Windows, OSX and Ubuntu.
* 4 platforms (XP/7/OSX/Ubuntu)
 
* A browser with the default theme, a dark theme and a light theme (for example [https://addons.mozilla.org/en-US/firefox/addon/simplewhite/ light] / [https://addons.mozilla.org/en-US/firefox/addon/nasa-night-launch/ dark])


== Formatting ==
== Formatting ==
Line 42: Line 40:
** Example: Use <tt>border-color: red</tt>, not <tt>border: red;</tt>
** Example: Use <tt>border-color: red</tt>, not <tt>border: red;</tt>


Naming Standards:
Naming Standards for class names:
* We have an official policy for class names
* lower-case-with-dashes is the most common
* lower-case-with-dashes seems to be most common, and it fits with 'the CSS way'
* But camelCase is also used sometimes.  It makes sense to first try to fit in with code around, and if there is doubt or if isn't anything to fit in with to use lower-case-with-dashes.
* camelCase is also used
* It makes sense to first try to fit in with code around, and if there is doubt or if isn't anything to fit in with to use lower-case-with-dashes.


== Performance ==
== Performance ==
Line 130: Line 126:
* [https://developer.mozilla.org/en/CSS/font#Mozilla_Extensions System Fonts]
* [https://developer.mozilla.org/en/CSS/font#Mozilla_Extensions System Fonts]
* [https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions CSS Extensions]
* [https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions CSS Extensions]
* Also [http://dxr.mozilla.org/mozilla/mozilla-central/toolkit/themes/pinstripe/global/shared.inc.html shared.inc.html] has some values (but there must be a better reference?)


== Tips ==
== Tips ==
Confirmed users
66

edits

Navigation menu