Skip to content

Type display as map #28451

@afanjul

Description

@afanjul

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;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions