Skip to content

Commit

Permalink
fix: align status indicator table to grid (#2681)
Browse files Browse the repository at this point in the history
* fix: align status indicator table to grid

* fix: align status indicator table to grid

* fix: align status indicator table to grid

* fix: align status indicator table to grid

* chore(status-indicator): add table layout width to force custom styles

* fix: safari on grid

Co-authored-by: Ale Davila <aledavila@ibm.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 18, 2022
1 parent d436958 commit 454065d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 13 deletions.
45 changes: 38 additions & 7 deletions src/components/StatusIndicatorTable/StatusIndicator.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
.iconGroup {
padding: 1rem;
display: flex;
width: 50%;
width: 100%;

@include carbon--breakpoint('lg') {
width: 50%;
}
}

.iconGroup.isDark {
Expand Down Expand Up @@ -79,16 +83,43 @@
border-bottom: none;
}

@media (max-width: 600px) {
.statusIndicatorTableWrapper {
margin-left: -1rem;
margin-right: -1rem;
}

@include carbon--breakpoint-between('sm', 'lg') {
.statusIndicatorTableWrapper {
margin-right: -1rem;
margin-left: -1rem;
overflow: scroll;
}
.iconGroup {
width: 100%;
}
.iconGroup.isDark {
display: none;
}
}

//Needed for Safari
.statusIndicatorTableWrapper {
@include carbon--breakpoint('md') {
:global(.bx--col-md-1) {
width: 12.5%;
}

:global(.bx--col-md-2) {
width: 25%;
}

:global(.bx--col-md-3) {
width: 37.5%;
}
}

@include carbon--breakpoint('lg') {
:global(.bx--col-lg-4) {
width: 33.333333%;
}

:global(.bx--col-lg-2) {
width: 16.66667%;
}
}
}
12 changes: 6 additions & 6 deletions src/components/StatusIndicatorTable/StatusIndicatorTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ import {
const StatusIndicatorTable = ({ attention }) => (
<div className={statusIndicatorTableWrapper}>
<StructuredListWrapper className={table}>
<StructuredListHead>
<StructuredListRow head>
<StructuredListCell className={headerCell} head>
<StructuredListHead className='bx--grid'>
<StructuredListRow className='bx--row' head>
<StructuredListCell className={`bx--col-lg-4 bx--col-md-1 ${headerCell}`} head>
Icon
</StructuredListCell>
<StructuredListCell className={headerCell} head>
<StructuredListCell className={`bx--col-lg-2 bx--col-md-2 ${headerCell}`} head>
Name
</StructuredListCell>
<StructuredListCell className={headerCell} head>
<StructuredListCell className={`bx--col-lg-2 bx--col-md-2 ${headerCell}`} head>
Token
</StructuredListCell>
<StructuredListCell className={headerCell} head>
<StructuredListCell className={`bx--col-lg-4 bx--col-md-3 ${headerCell}`} head>
Description & usage
</StructuredListCell>
</StructuredListRow>
Expand Down

1 comment on commit 454065d

@vercel
Copy link

@vercel vercel bot commented on 454065d Jan 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.