Skip to content

USWDS - Bug: Error in card padding setting #5515

@amyleadem

Description

@amyleadem

Summary

When setting custom values for $theme-card-padding-y, some values that the system says are acceptable cause an error.

For example: $theme-card-padding-y: 15 results in the following error:

Error: "`7.5` is not a valid `padding` token. You should correct this. Standard `padding` tokens:  1px, 2px, 05, 1, 105, 2, 205, 3, 4, 5, 6, 7, 8, 9, 10, 15, 0"
   ╷
25 │     padding-#{$side}: get-uswds-value("padding", $value...) #{$important};
   │                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  packages/uswds-core/src/styles/mixins/utilities/_padding.scss 25:23  padding-n()
  packages/uswds-core/src/styles/mixins/utilities/_padding.scss 50:3   u-padding-bottom()
  packages/usa-card/src/styles/_usa-card.scss 81:3                     @forward
  usa-card/src/_index.scss 4:1                                         @forward
  packages/uswds/_index.scss 20:1                                      @forward
  src/stylesheets/uswds.scss 3:1                                       root stylesheet 

I suspect it is because we run math.div inside u-padding mixins. For example:

@include u-padding-bottom(math.div($theme-card-padding-y, 2));

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions