Skip to content

Commit c19973e

Browse files
SurenNewarerfrandse
authored andcommitted
Add stacked table style for small screen
- Add style to the stacked table type for small screen only. Signed-off-by: Suren Neware <[email protected]> Change-Id: I79fb44b20c8436df5734f89e60c98966c9c6a591
1 parent 6db7e88 commit c19973e

File tree

3 files changed

+70
-1
lines changed

3 files changed

+70
-1
lines changed

src/assets/styles/bmc/custom/_tables.scss

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,71 @@
6666
border-top: none;
6767
}
6868

69+
// Table stacked style for small screen only
70+
@include media-breakpoint-down(xs) {
71+
.b-table-stacked-sm {
72+
border: 1px solid gray("300");
73+
74+
tr {
75+
76+
&:not(:first-child) > td[aria-colindex='1'] {
77+
border-top: 1px solid gray("300");
78+
padding-top: 0.625rem;
79+
}
80+
81+
&:not(.b-table-empty-row) {
82+
position: relative; // Restrict background color to get zebra striping for the row
83+
84+
&::before,
85+
&::after {
86+
position: absolute;
87+
top: 0;
88+
height: 100%;
89+
z-index: -1;
90+
}
91+
92+
&:before {
93+
content: '';
94+
background-color: gray("200");
95+
width: 40%;
96+
border-right: 1px solid gray("300");
97+
}
98+
99+
&:after {
100+
content: '';
101+
right: 0;
102+
width: 60%;
103+
}
104+
105+
&:nth-child(even)::after {
106+
background-color: gray("100"); // Zebra striping for the row
107+
}
108+
}
109+
110+
td {
111+
border: 0;
112+
padding: 0.75rem;
113+
text-align: left !important;
114+
115+
&:last-of-type {
116+
border-right: 0;
117+
}
118+
}
119+
}
120+
}
121+
122+
.table.b-table.b-table-stacked-sm > tbody > tr > [data-label] {
123+
&::before {
124+
text-align: left;
125+
padding-left: $spacer /2;
126+
}
127+
128+
> div {
129+
padding-left: 1rem;
130+
}
131+
}
132+
133+
.table.b-table.b-table-stacked-sm > tbody > tr > :first-child {
134+
border-top-width: 1px;
135+
}
136+
}

src/views/AccessControl/LocalUserManagement/TableRoles.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default {
116116
}
117117
],
118118
fields: [
119-
{ key: 'description', label: '' },
119+
{ key: 'description', label: 'Privilege' },
120120
{ key: 'administrator', label: 'Administrator', class: 'text-center' },
121121
{ key: 'operator', label: 'Operator', class: 'text-center' },
122122
{ key: 'readonly', label: 'ReadOnly', class: 'text-center' },

src/views/Overview/OverviewEvents.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
sort-by="id"
1414
sort-desc
1515
responsive="md"
16+
stacked="sm"
1617
show-empty
1718
:items="eventLogData"
1819
:fields="fields"

0 commit comments

Comments
 (0)