Visitar URL original
USWDS - Icon list: Allow $theme-body-font-size to accept all size tokens by amyleadem · Pull Request #5363 · uswds/uswds · GitHub
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions packages/usa-icon-list/src/styles/_usa-icon-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,16 @@ $icon-list-icon-padding-left-factor: 0.4;
// Fine tune the title top padding given a line height of lh-2
$icon-list-title-padding-top: 0.425ex;

$theme-body-font-sizes: (
"xs": $theme-type-scale-xs,
"sm": $theme-type-scale-sm,
"md": $theme-type-scale-md,
"lg": $theme-type-scale-lg,
"xl": $theme-type-scale-xl,
"2xl": $theme-type-scale-2xl,
"3xl": $theme-type-scale-3xl,
);

$type-scale: font-size($theme-icon-list-font-family, $theme-body-font-size);

// Get fixed size for icon, based on non-normalized size token
$this-system-token: if(
map.has-key($theme-body-font-sizes, $theme-body-font-size),
map.get($theme-body-font-sizes, $theme-body-font-size),
map.has-key($all-type-scale, $theme-body-font-size),
map.get($all-type-scale, $theme-body-font-size),
$theme-body-font-size
);
$this-icon-size-px: map.get($system-type-scale, $this-system-token);
$icon-size: px-to-rem($this-icon-size-px);

$icon-size: px-to-rem($this-system-token);

@include override-prose {
.usa-icon-list {
Expand Down Expand Up @@ -112,7 +102,7 @@ $icon-list-breakpoints: map-merge($this-null, $system-breakpoints);
}

@include at-media($mq-key) {
@each $token, $val in $theme-body-font-sizes {
@each $token, $val in $all-type-scale {
@if $prefix {
$this-type-scale: font-size($theme-icon-list-font-family, $token);
.#{$prefix}usa-icon-list--size-#{$token} {
Expand Down