id
.
id
s have a higher specificity than classes or elements and as such behave unpredictablydiv
or span
, use a CSS class instead of just targeting div
/span
in the CSS file.
div
that’s a child of nav
that’s a direct child of ul
that’s a direct child of some-component
,
I have much less of an idea of what’s going on than if I see something like parent-component.help-link { color: $grey; etc }
. section div p span i {
margin: 10px
}
@import
command to import files that set variables.@import
a partial which generates styles, and the partial is called or imported elsewhere, the generated CSS will contain duplicate styles.
Only use @import
on ‘safe’ partials which generate and set variables for use elsewhere, but don’t produce any CSS.
Then, the files which call @import
on these ‘safe’ partials can use these common variables to generate styles as needed.Must READ link
Strings should be declared constants and associated with a language i.e: All English strings are grouped together.
When referring to specific links or buttons in the application, use the casing in the specific link or button.
Example text:
Exception : if the link in question is in ALL CAPS, do not refer to it with ALL CAPS. Instead use title case. This capitalization is intended for use in headers and should not be used in general copy.
Examples of a domain object: markers, users, charts, dashboards, reports.
Do not capitalize domain objects unless
Generally, use title case for short, terse phrases in titles, tooltips, navigation elements, etc.
If the text you are using is longer than 3-5 words, strongly consider using sentence case instead.
If copying a considerable amount of CSS from another place, consider extracting them to _todo.scss
or
putting a comment on your new code so they can be modified together in the future.
_todo.scss
0
getting set, like padding: 0
? This is likely overwriting something… which we want to avoid as much as possible.Need to make sure things have the right aria
attributes that let screen readers know how they should be used, and also have keyboard accessibility.
We can get a lot of mileage out of using default controls, but sometimes we can’t. (the accordion behaviour on the search page table, modals…)