--- layout: page title: Customising the design author: dave --- # Customising the design
This page describes how to change the directionality and colour scheme of your installation — which is a good starting point for further customisations.
## Background The CSS is stored in `web/cobrands/` under which there are directories for Cobrands. Note that FixMyStreet uses SCSS and Compass to generate its CSS so there are no CSS files until `bin/make_css` has been run as the site user. The CSS provided with FixMyStreet uses CSS3 media queries in a mobile-first format order to adapt the layout to work on different devices. It is structured into these main files: * `base.css` -- all the styling for the content of the pages in a mobile sized browser. * `layout.css` -- all the styling for the content of the pages in a desktop sized browser. * `_colours.css` -- basic settings information, so you can easily make a site that looks different simply by copying these files to your own cobrand CSS directory, and changing the contents, as we will describe below. Our `.gitignore` file assumes that any CSS files directly in a `cobrands/*` directory are generated from SCSS - if you have CSS files that you want to use directly, put them in a `css` directory within your cobrand directory. # Tutorial You can override any of the CSS or HTML templates of your FixMyStreet installation, but to begin with it's a good idea to just change the colours. That way you can learn how FixMyStreet customisation works, before tackling more complex layout, design, or code changes. ## Start simple! FixMyStreet's default CSS comes with a few basic colour settings which you can change. Remember that ultimately **you can override any styling for your own site** but most of this page shows how to set your own colours *without adding any new HTML or CSS*. We know that you'll want to change more than just the default colours: but this is the best way to start. Once you've done this, you'll have your own cobrand, and can start changing other stylesheets and templates in the same way. ## Why you should create a cobrand A cobrand is just FixMyStreet's way of separating your customisation from everybody else's. To start with, this is almost as simple as putting what you need in its own directory.web/cobrands/default/_colours.scss
and run
bin/make_css
) but we strongly recommend you do
not do that. It's OK if you just want to play with the settings to see what's
possible, but the right way to change how your site looks is to make a
cobrand.
ALLOWED_COBRANDS
config variable to decide which cobrand to use. In `conf/general.yml`, set it to your new cobrand like this:
ALLOWED_COBRANDS:
- fixmypark
In fact, `ALLOWED_COBRANDS` is
[a little more complex that it looks]({{ "/customising/config/#allowed_cobrands" | relative_url }}).
If you give it a list of cobrands, it will decide which one to use depending on string
matches on the incoming URL *for every request* But for most cases you don't want it to switch.
So if you just specify just one cobrand like this, FixMyStreet will simply use it.
### Create a directory for your cobrand in web/cobrands
Make a new directory with your cobrand's name in `web/cobrands/` For example,
on the command line, do:
cd fixmystreet
mkdir web/cobrands/fixmypark
### Copy the default cobrand's CSS into yours
Copy the contents of `web/cobrands/default` into that directory.
cp web/cobands/default/* web/cobrands/fixmypark
This puts the stylesheet files you need into your cobrand.
At this point, your cobrand is effectively a copy of the default one.
### Edit the colours
The default cobrand's colour scheme, which you have copied, will be blue and
orange — we picked startling colours to force people to want to customise it.
We use SCSS (instead of CSS) because it's a more powerful way of defining and
managing styles. This means that when you make any changes, FixMyStreet needs
to compile those SCSS files to rebuild the CSS — see the following
section.
You can edit the colours defined in `web/cobrands/fixmypark/_colours.scss`.
You'll need to use [web colour
codes](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Co
lor) to specify the colours you want.
Be careful: if you're not familiar with SCSS, the syntax of that file is a
little strict. Typically, those colours *must* always be either exactly three
or six hex characters long. And there must be a `#` before and a semicolon after each one.
These are the colours which you can easily change within your copy of the
stylesheet:
variable | examples of where it's used in the default cobrand |
---|---|
$primary
|
the front page's main banner background |
$primary_b
|
border around the the front page street/area input |
$primary_text
|
text on the front page banner |
$base_bg $base_fg
|
Large width page background/foreground (bleeding to edge) |
$map_nav_bg $nav_fg
|
Mobile width, the header's colours; large width, the navigation's foreground colour |
$menu-image
|
“Hamburger” menu colour (menu-black or
menu-white )
|
$col_click_map |
background of the "click map to report problem" banner on the map page |
$col_fixed_label $col_fixed_label_dark
|
background of the colour of the "fixed" label that appears on fixed reports, and its darker underside |
$col_big_numbers
|
Colour to use for the step numbers on the front page. |