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

Type display as map #28451

Closed
afanjul opened this issue Mar 11, 2019 · 3 comments
Closed

Type display as map #28451

afanjul opened this issue Mar 11, 2019 · 3 comments
Labels

Comments

@afanjul
Copy link

afanjul commented Mar 11, 2019

Why do you code "display-x" class types, as a separatad variables, instead of a more "robust and best practice" code using a map (as many other parts in bootstrap)? I think that using a map it would be easier to extend or remove display types...

In _variables.scss

$displays: (
  1:(6rem, 300),
  2:(5.5rem, 300),
  3:(4.5rem, 300),
  4:(3.5rem, 300),
);

In _types:

@each $index,$values in $displays {
  .display-#{$index} {
    @include font-size(#{nth($values,1)});
    font-weight: #{nth($values,2)};
    line-height: $display-line-height;
  }
}
@bardiharborow
Copy link
Member

I think last time we tried this, it caused people problems having to redefine the whole map.

@afanjul
Copy link
Author

afanjul commented Mar 22, 2019

I think last time we tried this, it caused people problems having to redefine the whole map.

That does not sound like a good reason to not implement it... is it? anyway I did a pull request with the code: #28453

@mdo
Copy link
Member

mdo commented Sep 19, 2020

Was done in #30568

@mdo mdo closed this as completed Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants