Skip to content

Commit

Permalink
update physical shorthands to logical equivalents (#1489)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 authored Aug 17, 2023
1 parent 2116965 commit e9226ce
Show file tree
Hide file tree
Showing 39 changed files with 170 additions and 109 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-horses-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-css': major
---

`--iui-color-dot-inset` has been split into `--iui-color-dot-inset-block` and `--iui-color-dot-inset-inline`.
6 changes: 3 additions & 3 deletions packages/itwinui-css/backstop/tests/color-picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ <h2>Advanced</h2>
>
<div
class="iui-color-dot"
style="--iui-color-dot-inset: 2% auto auto 79.2157%;"
style="--iui-color-dot-inset-block: 2% auto; --iui-color-dot-inset-inline: 79.2157% auto;"
tabindex="0"
id="test-color-dot"
></div>
Expand Down Expand Up @@ -367,7 +367,7 @@ <h2>Advanced</h2>
>
<div
class="iui-color-dot"
style="--iui-color-dot-inset: 2% auto auto 79.2157%;"
style="--iui-color-dot-inset-block: 2% auto; --iui-color-dot-inset-inline: 79.2157% auto;"
tabindex="0"
></div>
</div>
Expand Down Expand Up @@ -520,7 +520,7 @@ <h2>Advanced</h2>
>
<div
class="iui-color-dot"
style="--iui-color-dot-inset: 2% auto auto 79.2157%;"
style="--iui-color-dot-inset-block: 2% auto; --iui-color-dot-inset-inline: 79.2157% auto;"
tabindex="0"
></div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion packages/itwinui-css/src/alert/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
}

.iui-alert-message {
margin: var(--iui-size-s) var(--iui-size-m);
margin-block: var(--iui-size-s);
margin-inline: var(--iui-size-m);
word-break: normal;
overflow-wrap: anywhere;
flex: 999;
Expand Down
4 changes: 2 additions & 2 deletions packages/itwinui-css/src/badge/badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ $iui-badge-horizontal-padding: calc(var(--iui-size-2xs) * 1.5);
@include mixins.iui-reset;
display: inline-block;
font-size: var(--iui-font-size-0);
padding: 0 $iui-badge-horizontal-padding;
margin: calc(var(--iui-size-s) * 0.5) 0;
padding-inline: $iui-badge-horizontal-padding;
margin-block: calc(var(--iui-size-s) * 0.5);
border: 1px solid var(--_iui-badge-border-color);
border-radius: var(--iui-border-radius-1);
background-color: var(--iui-badge-background-color);
Expand Down
5 changes: 3 additions & 2 deletions packages/itwinui-css/src/blockquote/blockquote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
@include surface.iui-surface;
display: block;
position: relative;
padding: var(--iui-size-s) var(--iui-size-m);
margin: var(--iui-size-s) 0;
padding-block: var(--iui-size-s);
padding-inline: var(--iui-size-m);
margin-block: var(--iui-size-s);
text-align: justify;
border-inline-start: var(--iui-size-xs) solid var(--iui-color-border);

Expand Down
4 changes: 2 additions & 2 deletions packages/itwinui-css/src/breadcrumbs/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}

@mixin iui-breadcrumbs-content {
padding: 0 var(--iui-size-xs);
padding-inline: var(--iui-size-xs);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
Expand Down Expand Up @@ -68,7 +68,7 @@

@mixin iui-breadcrumbs-separator {
display: flex;
margin: 0 var(--iui-size-3xs);
margin-inline: var(--iui-size-3xs);

svg {
@include mixins.iui-icon-style('s');
Expand Down
8 changes: 5 additions & 3 deletions packages/itwinui-css/src/button/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@
}

@mixin iui-button-active {
--_iui-button-active-stripe-inset: initial;
--_iui-button-active-stripe-inset-block: initial;
--_iui-button-active-stripe-inset-inline: initial;
--_iui-button-active-stripe-background: var(--iui-color-border-accent);
--_iui-button-text-color: var(--iui-color-text-accent);
--_iui-button-icon-fill: var(--iui-color-text-accent);

// Shows active stripe only if --_iui-button-active-stripe-inset is set (from outside)
// Shows active stripe only if --_iui-button-active-stripe-inset- properties are set (from outside)
&::after {
content: '';
position: absolute;
inset: var(--_iui-button-active-stripe-inset);
inset-block: var(--_iui-button-active-stripe-inset-block);
inset-inline: var(--_iui-button-active-stripe-inset-inline);
background: var(--_iui-button-active-stripe-background);
}

Expand Down
11 changes: 4 additions & 7 deletions packages/itwinui-css/src/button/button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@

// Adds stripe to active button
@if $orientation == 'horizontal' {
--_iui-button-active-stripe-inset: #{var(--iui-size-3xs)}
#{var(--iui-size-3xs)}
calc(100% - #{var(--iui-size-2xs)});
--_iui-button-active-stripe-inset-block: #{var(--iui-size-3xs)} calc(100% - #{var(--iui-size-2xs)});
--_iui-button-active-stripe-inset-inline: #{var(--iui-size-3xs)};
} @else {
--_iui-button-active-stripe-inset: #{var(--iui-size-3xs)}
calc(100% - #{var(--iui-size-2xs)})
#{var(--iui-size-3xs)}
#{var(--iui-size-3xs)};
--_iui-button-active-stripe-inset-block: #{var(--iui-size-3xs)};
--_iui-button-active-stripe-inset-inline: #{var(--iui-size-3xs)} calc(100% - #{var(--iui-size-2xs)});
}

&:hover {
Expand Down
4 changes: 2 additions & 2 deletions packages/itwinui-css/src/code/code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

.iui-codeblock {
@include mixins.iui-reset;
margin: calc(var(--iui-size-s) * 0.5) 0;
margin-block: calc(var(--iui-size-s) * 0.5);

> .iui-title-bar {
display: flex;
Expand Down Expand Up @@ -62,7 +62,7 @@
content: counter(section);
text-align: end;
display: inline-block;
padding: 0 var(--iui-size-xs);
padding-inline: var(--iui-size-xs);
inline-size: calc(var(--iui-size-l) + 2 * var(--iui-size-xs)); // 2 * iui-size-xs for the padding
background-color: var(--iui-color-background-backdrop);
color: var(--iui-color-text-muted);
Expand Down
8 changes: 5 additions & 3 deletions packages/itwinui-css/src/color-picker/color-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $iui-hover-box-shadow: 0 0 0 var(--iui-size-3xs) var(--iui-color-border);
@include surface.iui-surface;
border-radius: var(--iui-border-radius-1);
display: inline-flex;
padding: var(--iui-size-s) var(--iui-size-s);
padding: var(--iui-size-s);
user-select: none;
overflow-y: auto;
flex-direction: column;
Expand Down Expand Up @@ -219,10 +219,12 @@ $iui-hover-box-shadow: 0 0 0 var(--iui-size-3xs) var(--iui-color-border);
}

.iui-color-dot {
--iui-color-dot-inset: initial;
--iui-color-dot-inset-block: initial;
--iui-color-dot-inset-inline: initial;

position: absolute;
inset: var(--iui-color-dot-inset);
inset-block: var(--iui-color-dot-inset-block);
inset-inline: var(--iui-color-dot-inset-inline);
inline-size: var(--iui-size-m);
block-size: var(--iui-size-m);
border-radius: 50%;
Expand Down
6 changes: 3 additions & 3 deletions packages/itwinui-css/src/date-picker/date-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ $iui-date-picker-today-circle-size: 32px;
inline-size: 100%;
align-items: center;
justify-content: space-between;
padding: 0 var(--iui-size-2xs);
padding-inline: var(--iui-size-2xs);
font-weight: var(--iui-font-weight-bold);
gap: var(--iui-size-2xs);

Expand All @@ -126,7 +126,7 @@ $iui-date-picker-today-circle-size: 32px;
.iui-calendar-weekdays {
line-height: $iui-date-picker-cell-height;
display: flex;
padding: 0 var(--iui-size-xs);
padding-inline: var(--iui-size-xs);
font-weight: var(--iui-font-weight-bold);
background-color: var(--iui-color-background-backdrop);

Expand All @@ -142,7 +142,7 @@ $iui-date-picker-today-circle-size: 32px;
white-space: nowrap;
line-height: $iui-date-picker-cell-height;
display: flex;
padding: 0 var(--iui-size-xs);
padding-inline: var(--iui-size-xs);
margin-block-end: var(--iui-size-3xs);
}

Expand Down
13 changes: 8 additions & 5 deletions packages/itwinui-css/src/dialog/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ $iui-dialog-min-height: 7.75rem; // 7.75rem = 124px = title bar height + margins
border-radius: var(--iui-border-radius-1);
box-shadow: var(--iui-shadow-5);
position: fixed;
padding: var(--iui-size-s) var(--iui-size-m);
padding-block: var(--iui-size-s);
padding-inline: var(--iui-size-m);
pointer-events: auto;
background-color: var(--iui-color-background);
display: flex;
Expand Down Expand Up @@ -160,8 +161,10 @@ $iui-dialog-min-height: 7.75rem; // 7.75rem = 124px = title bar height + margins

.iui-dialog-title-bar-filled {
font-size: var(--iui-font-size-2);
padding: calc(var(--iui-size-s) * 0.5) var(--iui-size-m);
margin: calc(0px - var(--iui-size-s)) calc(0px - var(--iui-size-m)) var(--iui-size-s) calc(0px - var(--iui-size-m)); // negative margin to counteract dialog padding
padding-block: calc(var(--iui-size-s) * 0.5);
padding-inline: var(--iui-size-m);
margin-inline: calc(0px - var(--iui-size-m)); // negative margin to counteract dialog padding
margin-block: calc(0px - var(--iui-size-s)) var(--iui-size-s);
cursor: grab;
background-color: var(--iui-color-background-backdrop);
border-block-end: 1px solid var(--iui-color-border);
Expand All @@ -173,8 +176,8 @@ $iui-dialog-min-height: 7.75rem; // 7.75rem = 124px = title bar height + margins

.iui-dialog-content {
flex-grow: 2;
margin: 0 calc(0px - var(--iui-size-m));
padding: 0 var(--iui-size-m);
margin-inline: calc(0px - var(--iui-size-m));
padding-inline: var(--iui-size-m);
overflow-y: auto;
overflow-y: overlay;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/itwinui-css/src/fieldset/fieldset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

.iui-fieldset {
@include mixins.iui-reset;
padding: var(--iui-size-s) var(--iui-size-s);
padding: var(--iui-size-s);
border-radius: var(--iui-border-radius-1);
border: 1px solid var(--iui-color-border);
background-color: var(--iui-color-background);
Expand Down
7 changes: 4 additions & 3 deletions packages/itwinui-css/src/footer/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

text-align: center;
inline-size: 100%;
padding: var(--iui-size-s) 0;
padding-block: var(--iui-size-s);
font-size: var(--iui-font-size-0);
}

.iui-legal-footer-list {
list-style-type: none;
margin: 0 auto;
margin-block: 0;
margin-inline: auto;
padding: 0;
display: flex;
justify-content: center;
Expand All @@ -41,7 +42,7 @@
}

.iui-legal-footer-separator {
margin: 0 var(--iui-size-xs);
margin-inline: var(--iui-size-xs);
inline-size: 1px;
block-size: var(--iui-size-s);
background-color: var(--iui-color-border);
Expand Down
4 changes: 2 additions & 2 deletions packages/itwinui-css/src/header/header-buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $iui-side-navigation-icon-margins: calc(1.5 * var(--iui-size-m));
@include mixins.iui-icon-style('l');
fill: var(--iui-color-icon);
}
margin: 0 $iui-side-navigation-icon-margins;
margin-inline: $iui-side-navigation-icon-margins;
will-change: transform;
transform: var(--_iui-header-icon-scale);
@media (prefers-reduced-motion: no-preference) {
Expand Down Expand Up @@ -163,7 +163,7 @@ $iui-side-navigation-icon-margins: calc(1.5 * var(--iui-size-m));
}

@mixin iui-header-breadcrumb-button-split {
padding: 0 var(--iui-size-xs);
padding-inline: var(--iui-size-xs);
margin-inline-start: calc(0px - var(--iui-size-xs));
flex-shrink: 0;

Expand Down
8 changes: 5 additions & 3 deletions packages/itwinui-css/src/input-container/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

.iui-input-group .iui-toggle-switch-wrapper {
padding: calc(var(--iui-size-s) * 0.5) 0;
padding-block: calc(var(--iui-size-s) * 0.5);
}

// #region Cursors
Expand Down Expand Up @@ -116,7 +116,8 @@

/// Modifier on iui-input-label-styling to place it inline.
@mixin iui-input-label-inline {
margin: 0 var(--iui-size-m) 0 0;
margin: 0;
margin-inline-end: var(--iui-size-m);

&.iui-required {
margin-inline-end: calc(var(--iui-size-2xs) * 1.5 - 1px);
Expand Down Expand Up @@ -178,7 +179,8 @@

grid-area: inputs;
justify-self: end;
margin: 0 #{$margin-end} 0 0;
margin: 0;
margin-inline-end: $margin-end;
position: relative;
block-size: 100%;
inline-size: fit-content;
Expand Down
3 changes: 2 additions & 1 deletion packages/itwinui-css/src/keyboard/keyboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
font-weight: var(--iui-font-weight-semibold);
font-family: var(--iui-font-mono);
line-height: 1;
padding: calc(var(--iui-size-s) * 0.33) var(--iui-size-xs);
padding-block: calc(var(--iui-size-s) * 0.33);
padding-inline: var(--iui-size-xs);
white-space: nowrap;
text-transform: uppercase;
user-select: none;
Expand Down
3 changes: 2 additions & 1 deletion packages/itwinui-css/src/location-marker/data-rich.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
border-radius: var(--iui-border-radius-1);
text-align: center;
font-size: var(--iui-font-size-2);
padding: calc(var(--iui-size-s) * 0.25) var(--iui-size-xs);
padding-block: calc(var(--iui-size-s) * 0.25);
padding-inline: var(--iui-size-xs);
filter: drop-shadow(var(--iui-shadow-1));
position: relative;
border: solid 1px var(--iui-color-white);
Expand Down
5 changes: 3 additions & 2 deletions packages/itwinui-css/src/menu/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $iui-active-outline: 1px solid var(--iui-color-border-accent);
}

@mixin iui-header-menu-icon {
margin: 0 var(--iui-size-2xs);
margin-inline: var(--iui-size-2xs);

&:is(div) {
@include mixins.iui-icon-style('l');
Expand Down Expand Up @@ -173,7 +173,8 @@ $iui-active-outline: 1px solid var(--iui-color-border-accent);
@mixin iui-menu-divider {
block-size: 1px;
inline-size: calc(100% - #{var(--iui-size-l)});
margin: 1px auto;
margin-block: 1px;
margin-inline: auto;
background-color: var(--iui-color-border);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/itwinui-css/src/non-ideal-state/non-ideal-state.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
display: inline-block;
inline-size: 200px;
text-align: start;
margin: 0 var(--iui-size-2xs) 0 0;
margin-inline-end: var(--iui-size-2xs);
}

> .iui-button {
margin: 0 var(--iui-size-2xs);
margin-inline: var(--iui-size-2xs);
}
}
4 changes: 2 additions & 2 deletions packages/itwinui-css/src/searchbox/searchbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
}

.iui-search-icon {
margin: 0 var(--iui-size-s);
margin-inline: var(--iui-size-s);

&:is(:first-child) {
margin: 0 var(--_iui-flex-input-icon-margin, 10px); // To match borderless button left padding + border
margin-inline: var(--_iui-flex-input-icon-margin, 10px); // To match borderless button left padding + border
}
}
5 changes: 3 additions & 2 deletions packages/itwinui-css/src/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@

@mixin iui-select-tag-container {
position: absolute;
inset-block: 0;
// align wth Select's padding
inset: 0 calc(var(--iui-size-m) + var(--iui-size-l)) 0 var(--iui-size-s);
inset-inline: var(--iui-size-s) calc(var(--iui-size-m) + var(--iui-size-l));
block-size: 100%;
display: flex;
align-items: center;
Expand Down Expand Up @@ -113,7 +114,7 @@
@include base.iui-button;
@include borderless.iui-button-borderless;
@include tag.iui-tag-button;
padding: 0 var(--iui-size-2xs);
padding-inline: var(--iui-size-2xs);
min-block-size: unset;
min-inline-size: unset;
block-size: 100%;
Expand Down
Loading

0 comments on commit e9226ce

Please sign in to comment.