Skip to content

Coding Guidelines

alisman edited this page Jan 15, 2020 · 4 revisions

Number formatting

To the extent possible, use Numeral.js library to format numbers. If there are existing formatting utility functions in the codebase which you are tempted to use, please inquire with a project lead as to how to proceed.

CSS Modules

We have adopted CSS Modules to avoid style collisions between css written for specific features/modules. The module approach transforms class names at compile time to make them unique to the modules that reference them.

There are still many legacy (not CSS modules) .scss files in the project. If you need to work in them, be aware that any class you put in these files is global (Yes, even though the file name is specific to a module). For that reason, take care to nest your new class inside a module specific sass wrapper. For example:

.myFeature {
    .myClass { ... }
}
Clone this wiki locally