Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(spacing): change layout variables to spacing #8063

Merged
merged 3 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/components/src/components/button/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@
@mixin button-padding-large {
align-items: baseline;
padding-top: $spacing-05;
padding-right: $layout-05;
padding-right: $spacing-10;
padding-left: $spacing-05;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
position: relative;
display: flex;
width: 100%;
height: $layout-04;
height: $spacing-09;
overflow: hidden;
background: $ui-01;
}
Expand All @@ -30,7 +30,7 @@
display: flex;
justify-content: flex-end;
width: 100%;
height: $layout-04;
height: $spacing-09;
transform: translate3d(0, 0, 0);
transition: transform $duration--fast-02 motion(standard, productive),
clip-path $duration--fast-02 motion(standard, productive);
Expand Down Expand Up @@ -60,24 +60,24 @@
//-------------------------------------------------
.#{$prefix}--toolbar-search-container-expandable {
position: relative;
width: $layout-04;
height: $layout-04;
width: $spacing-09;
height: $spacing-09;
box-shadow: none;
transition: flex $transition--expansion $carbon--standard-easing;
}

.#{$prefix}--toolbar-search-container-expandable .#{$prefix}--search {
position: initial;
width: $layout-04;
width: $spacing-09;
height: 100%;
}

.#{$prefix}--toolbar-search-container-expandable
.#{$prefix}--search
.#{$prefix}--search-magnifier {
left: 0;
width: $layout-04;
height: $layout-04;
width: $spacing-09;
height: $spacing-09;
padding: $spacing-05;
cursor: pointer;
transition: background $duration--fast-02 motion(entrance, productive);
Expand Down Expand Up @@ -135,8 +135,8 @@
.#{$prefix}--toolbar-search-container-expandable
.#{$prefix}--search
.#{$prefix}--search-close {
width: $layout-04;
height: $layout-04;
width: $spacing-09;
height: $spacing-09;

&::before {
top: 2px;
Expand Down Expand Up @@ -239,8 +239,8 @@
@include button-reset;

display: flex;
width: $layout-04;
height: $layout-04;
width: $spacing-09;
height: $spacing-09;
padding: $spacing-05;
cursor: pointer;
transition: background $duration--fast-02 motion(entrance, productive);
Expand All @@ -251,8 +251,8 @@
@include button-reset;

display: flex;
width: $layout-04;
height: $layout-04;
width: $spacing-09;
height: $spacing-09;
cursor: pointer;
transition: background $duration--fast-02 motion(entrance, productive);
}
Expand Down Expand Up @@ -291,16 +291,16 @@
}

.#{$prefix}--overflow-menu--data-table {
height: $layout-04;
height: $spacing-09;
}

//-------------------------------------------------
//TOOLBAR BUTTON ICONS
//-------------------------------------------------
.#{$prefix}--toolbar-action__icon {
width: auto;
max-width: $layout-01;
height: $layout-01;
max-width: $spacing-05;
height: $spacing-05;
fill: $icon-01;
}

Expand All @@ -310,7 +310,7 @@
.#{$prefix}--toolbar-search-container-persistent {
position: relative;
width: 100%;
height: $layout-04;
height: $spacing-09;
opacity: 1;
}

Expand All @@ -333,7 +333,7 @@
.#{$prefix}--toolbar-search-container-persistent
.#{$prefix}--search
.#{$prefix}--search-input {
height: $layout-04;
height: $spacing-09;
padding: 0 $spacing-09;
border: none;
}
Expand Down Expand Up @@ -362,8 +362,8 @@
.#{$prefix}--toolbar-search-container-persistent
.#{$prefix}--search
.#{$prefix}--search-close {
width: $layout-04;
height: $layout-04;
width: $spacing-09;
height: $spacing-09;
}

.#{$prefix}--batch-actions--active ~ .#{$prefix}--toolbar-search-container,
Expand Down Expand Up @@ -470,7 +470,7 @@
left: 0;
display: block;
width: rem(1px);
height: $layout-01;
height: $spacing-05;
background-color: $text-04;
border: none;
opacity: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

.#{$prefix}--data-table tr {
width: 100%;
height: $layout-04;
height: $spacing-09;
border: none;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// -------------------------------------
.#{$prefix}--data-table--sort th,
.#{$prefix}--data-table th[aria-sort] {
height: $layout-04;
height: $spacing-09;
padding: 0;
border-top: none;
border-bottom: none;
Expand Down Expand Up @@ -122,7 +122,7 @@

.#{$prefix}--table-sort__icon-unsorted {
width: rem(20px);
min-width: $layout-01;
min-width: $spacing-05;
margin-right: $spacing-03;
margin-left: $spacing-03;
opacity: 0;
Expand Down Expand Up @@ -151,7 +151,7 @@

.#{$prefix}--table-sort__icon {
width: rem(20px);
min-width: $layout-01;
min-width: $spacing-05;
margin-right: $spacing-03;
margin-left: $spacing-03;
transform: rotate(0);
Expand Down
7 changes: 7 additions & 0 deletions packages/components/src/globals/scss/_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,40 +109,47 @@ $spacing-3xl: $spacing-baseline * 3 !default;
/// @access public
/// @type Number
/// @group global-spacing
/// @deprecated
$layout-2xs: $spacing-baseline !default;

/// 24px layout in rem units
/// @access public
/// @type Number
/// @group global-spacing
/// @deprecated
$layout-xs: $spacing-baseline * 1.5 !default;

/// 32px layout in rem units
/// @access public
/// @type Number
/// @group global-spacing
/// @deprecated
$layout-sm: $spacing-baseline * 2 !default;

/// 48px layout in rem units
/// @access public
/// @type Number
/// @group global-spacing
/// @deprecated
$layout-md: $spacing-baseline * 3 !default;

/// 64px layout in rem units
/// @access public
/// @type Number
/// @group global-spacing
/// @deprecated
$layout-lg: $spacing-baseline * 4 !default;

/// 96px layout in rem units
/// @access public
/// @type Number
/// @group global-spacing
/// @deprecated
$layout-xl: $spacing-baseline * 6 !default;

/// 160px layout in rem units
/// @access public
/// @type Number
/// @group global-spacing
/// @deprecated
$layout-2xl: $spacing-baseline * 10 !default;
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ Array [
"spacing10",
"spacing11",
"spacing12",
"spacing13",
"styles",
"support01",
"support02",
Expand Down
3 changes: 3 additions & 0 deletions packages/layout/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const spacing09 = miniUnits(6);
export const spacing10 = miniUnits(8);
export const spacing11 = miniUnits(10);
export const spacing12 = miniUnits(12);
export const spacing13 = miniUnits(20);
export const spacing = [
spacing01,
spacing02,
Expand All @@ -115,6 +116,7 @@ export const spacing = [
spacing10,
spacing11,
spacing12,
spacing13,
];

// Fluid spacing
Expand All @@ -130,6 +132,7 @@ export const fluidSpacing = [
];

// Layout
// Deprecated -- Remove in v11
export const layout01 = miniUnits(2);
export const layout02 = miniUnits(3);
export const layout03 = miniUnits(4);
Expand Down
2 changes: 2 additions & 0 deletions packages/layout/src/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const unstable_tokens = [
'spacing10',
'spacing11',
'spacing12',
'spacing13',

// Fluid spacing
'fluidSpacing01',
Expand All @@ -27,6 +28,7 @@ export const unstable_tokens = [
'fluidSpacing04',

// Layout
// Deprecated -- Remove in v11
'layout01',
'layout02',
'layout03',
Expand Down
2 changes: 2 additions & 0 deletions packages/themes/src/g10.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,14 @@ export {
spacing10,
spacing11,
spacing12,
spacing13,
// Fluid spacing
fluidSpacing01,
fluidSpacing02,
fluidSpacing03,
fluidSpacing04,
// Layout
// Deprecated -- Remove in v11
layout01,
layout02,
layout03,
Expand Down
2 changes: 2 additions & 0 deletions packages/themes/src/g100.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,14 @@ export {
spacing10,
spacing11,
spacing12,
spacing13,
// Fluid spacing
fluidSpacing01,
fluidSpacing02,
fluidSpacing03,
fluidSpacing04,
// Layout
// Deprecated -- Remove in v11
layout01,
layout02,
layout03,
Expand Down
2 changes: 2 additions & 0 deletions packages/themes/src/g90.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,14 @@ export {
spacing10,
spacing11,
spacing12,
spacing13,
// Fluid spacing
fluidSpacing01,
fluidSpacing02,
fluidSpacing03,
fluidSpacing04,
// Layout
// Deprecated -- Remove in v11
layout01,
layout02,
layout03,
Expand Down
2 changes: 2 additions & 0 deletions packages/themes/src/v9.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ export {
spacing10,
spacing11,
spacing12,
spacing13,
// Fluid spacing
fluidSpacing01,
fluidSpacing02,
fluidSpacing03,
fluidSpacing04,
// Layout
// Deprecated -- Remove in v11
layout01,
layout02,
layout03,
Expand Down
2 changes: 2 additions & 0 deletions packages/themes/src/white.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,14 @@ export {
spacing10,
spacing11,
spacing12,
spacing13,
// Fluid spacing
fluidSpacing01,
fluidSpacing02,
fluidSpacing03,
fluidSpacing04,
// Layout
// Deprecated -- Remove in v11
layout01,
layout02,
layout03,
Expand Down