Skip to content

px-to-rem() returns a string instead of a rem value #5533

@RiZKiT

Description

@RiZKiT

Which generators are affected?

  • All
  • HTML
  • React
  • Angular
  • Vue
  • Web components
  • Power Apps

Reproduction case

The current implementation of px-to-rem() does not return a value but a string. I stumbled upon this issue while creating a very similar function in our code. The way it is currently implemented does not allow calculations with the value:

@function px-to-rem($pxValue) {
@return #{$pxValue * 0.0625}rem;
}

Expected Behaviour

The return value should be a rem value, therefore the function neede to be adjusted in this way:

instead of: @return #{$pxValue * 0.0625}rem;
use this: @return ($pxValue * 0.0625) * 1rem;

For completeness, I also found it here: sass/sass#2356 (comment)

Screenshots

No response

Browser version

None

Add any other context about the problem here.

No response

Which DB business unit do you work for?

Delivery-Team Web Development 1 (TO.IP D-T-037)

”DB Systel” please enter your customer / ”other” please enter your area or business unit.

No response

What project are you working on?

No response

Metadata

Metadata

Type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions