Skip to content

Commit

Permalink
fixup! fixup! Refactor(web): Refactor placement transformation to all…
Browse files Browse the repository at this point in the history
…ow input of logical placements
  • Loading branch information
crishpeen committed May 9, 2024
1 parent b17b024 commit 8fb1231
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/web/src/scss/tools/__tests__/_placement.test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
@include true.it('should return correct physical placement') {
@include true.assert {
@include true.output {
--logical-to-physical-start-horizontal: #{placement.logical-to-physical('start', 'horizontal')};
--logical-to-physical-start-vertical: #{placement.logical-to-physical('start', 'vertical')};
--logical-to-physical-start-horizontal: #{placement.transform-logical-to-physical('start', 'horizontal')};
--logical-to-physical-start-vertical: #{placement.transform-logical-to-physical('start', 'vertical')};
}
@include true.expect {
--logical-to-physical-start-horizontal: left;
Expand Down
6 changes: 3 additions & 3 deletions packages/web/src/scss/tools/_placement.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ $_hyphen: '-';
}

// Function to return a physical placement name
// Example: logical-to-physical('start', $direction: 'horizontal') will return 'left'
@function logical-to-physical($logical, $direction) {
// Example: transform-logical-to-physical('start', $direction: 'horizontal') will return 'left'
@function transform-logical-to-physical($logical, $direction) {
@return map.get($_logical-to-physical-placement-map, $direction, $logical);
}

Expand All @@ -154,7 +154,7 @@ $_hyphen: '-';
}

@if $physical-direction {
$axis-transformed: logical-to-physical($axis-transformed, $physical-direction);
$axis-transformed: transform-logical-to-physical($axis-transformed, $physical-direction);
}
} @else if $inverse {
$axis-transformed: map.get($_physical-placement-inverse-map, $axis);
Expand Down

0 comments on commit 8fb1231

Please sign in to comment.