Skip to content

Commit

Permalink
fix(title-bar-module): tweak spacing (#1124)
Browse files Browse the repository at this point in the history
* fix(title-bar-module): tweak spacing

* fix: update `TitleBarModule` style snapshot

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
SimonFinney and kodiakhq[bot] committed Nov 2, 2021
1 parent 145537d commit 1c21534
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
10 changes: 7 additions & 3 deletions src/__tests__/scss/__snapshots__/styles-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13703,16 +13703,20 @@ li.bx--accordion__item--disabled:last-of-type {

.security--layout-module--title-bar__items {
display: flex;
align-items: center;
margin-top: 0.25rem;
margin-left: auto;
}

.security--layout-module--title-bar__items--subsection {
margin-top: 0.125rem;
}

.security--layout-module--title-bar--label .security--layout-module--title-bar__items {
margin-top: 1.5rem;
}

.security--layout-module--title-bar--subsection .security--layout-module--title-bar__items {
margin-top: 0.75rem;
.security--layout-module--title-bar--label .security--layout-module--title-bar__items--subsection {
margin-top: 1rem;
}

.security--layout-module--title-bar--subsection .security--layout-module--title-bar__title {
Expand Down
20 changes: 11 additions & 9 deletions src/components/LayoutModules/TitleBarModule/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,26 @@

&__items {
display: flex;
align-items: center;
margin-top: $carbon--spacing-02;
margin-left: auto;

&--subsection {
margin-top: $carbon--spacing-01;
}
}

&--label &__items {
margin-top: $carbon--spacing-06;
}

&--subsection & {
&__items {
margin-top: $carbon--spacing-04;
&--subsection {
margin-top: $carbon--spacing-05;
}
}

&__title {
@include carbon--type-style($name: productive-heading-02);
&--subsection &__title {
@include carbon--type-style($name: productive-heading-02);

order: 1;
}
order: 1;
}

&__label-wrapper {
Expand Down
9 changes: 8 additions & 1 deletion src/components/LayoutModules/TitleBarModule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ const TitleBarModule = ({
</div>

{children && (
<LayoutModule namespace={`${namespace}__items`}>{children}</LayoutModule>
<LayoutModule
className={classnames({
[`${layoutModuleNamespace}--${namespace}__items--subsection`]:
subsection,
})}
namespace={`${namespace}__items`}>
{children}
</LayoutModule>
)}
</LayoutModule>
);
Expand Down

0 comments on commit 1c21534

Please sign in to comment.