Add !default attribute to $carbon--font-families map to allow developer override. #6648
Labels
proposal: accepted
This request has gone through triaging and we are accepting PR's against it.
type: enhancement 💡
Summary
I'm looking for the ability to overwrite the
$carbon--font-families
map defined in_font-family.scss
when building the Carbon SCSS myself.Testing in my current project this appears to work by adding the
!default
attribute to the map.Interestingly, and I'm not sure if this is indicative of something I'm doing wrong, the other map defined in that file,
$carbon--font-weights,
can be overwritten without adding the!default
attribute 🤷♂️This would require development.
Justification
This would better support projects outside of the IBM ecosystem looking to customize the look & feel of Carbon.
This is similar to #4855, and would support that case without the need for additional user-defined boilerplate.
Desired UX and success metrics
Developer-users would be able (but not required) to redefine the
$carbon--font-families
map and have their desired values used in place of the Carbon defaults."Must have" functionality
Ability to overwrite the default map
$carbon--font-families
in project SCSS to provide custom values.Specific timeline issues / requests
No particular timeline.
NB: The Carbon team will try to work with your timeline, but it's not
guaranteed. The earlier you make a request in advance of a desired delivery
date, the better!
Available extra resources
If this is as straight forward as just updating the maps as below I'm happy to submit a PR. This worked in the project I'm working on (changing the _font-family file in node_modules), but I'm not sure if there are other dependencies or gotchas I may not be aware of.
Carbon is a collaborative system. We encourage teams to build components and
submit them for integration as either add-ons or core components.
The text was updated successfully, but these errors were encountered: