Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add !default attribute to $carbon--font-families map to allow developer override. #6648

Closed
BenjaminWFox opened this issue Aug 11, 2020 · 1 comment · Fixed by #6850
Closed
Assignees
Labels
proposal: accepted This request has gone through triaging and we are accepting PR's against it. type: enhancement 💡

Comments

@BenjaminWFox
Copy link

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.

/// Font family fallbacks for: IBM Plex Mono, IBM Plex Sans, IBM Plex Sans
/// Condensed, IBM Plex Sans Hebrew, and IBM Plex Serif
/// @type Map
/// @access public
/// @group @carbon/type
$carbon--font-families: (
  'mono':
    unquote(
      "'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace"
    ),
  'sans': unquote("'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif"),
  'sans-condensed':
    unquote("'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif"),
  'sans-hebrew':
    unquote(
      "'IBM Plex Sans Hebrew', 'Helvetica Hebrew', 'Arial Hebrew', sans-serif"
    ),
  'serif': unquote("'IBM Plex Serif', 'Georgia', Times, serif"),
) !default;

Carbon is a collaborative system. We encourage teams to build components and
submit them for integration as either add-ons or core components.

@tw15egan tw15egan added proposal: open This request has gone through triaging. We're determining whether we take this on or not. and removed status: needs triage 🕵️‍♀️ labels Aug 17, 2020
@aledavila aledavila added proposal: accepted This request has gone through triaging and we are accepting PR's against it. and removed proposal: open This request has gone through triaging. We're determining whether we take this on or not. labels Sep 11, 2020
@aledavila
Copy link
Contributor

We are accepting this proposal. We want to add the rest of the font stack for the other languages.

@vpicone do you happen to know what the font stack is ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal: accepted This request has gone through triaging and we are accepting PR's against it. type: enhancement 💡
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants