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(bcd): make BCD table's header sticky #8541

Closed
wants to merge 15 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,76 @@
width: calc(100% + 6rem);
}

.bc-table-container {
margin: 1rem -3rem 0;
max-height: calc(100vh - var(--main-document-header-height) - 8rem);
}

.bc-table {
border: none;
margin: 0 0 1rem;

tbody tr {
td:last-child {
border-right: 1px solid var(--border-primary);
}

th {
border-left: 1px solid var(--border-primary);
}

&:last-child {
td {
border-bottom-color: var(--border-primary);

&:last-child {
border-bottom-right-radius: var(--elem-radius);
}
}

th {
border-bottom-color: var(--border-primary);
border-bottom-left-radius: var(--elem-radius);
}
}
}

thead {
background-color: var(--background-primary);
position: sticky;
top: 0;
z-index: var(--z-index-low);
}

tbody th {
width: 20%;
}
}

.bc-browsers {
td {
border-left: 1px solid var(--border-primary);
}

th:last-child {
border-right: 1px solid var(--border-primary);
}
}

.bc-platforms {
td {
border-left: 1px solid var(--border-primary);
border-top: 1px solid var(--border-primary);
border-top-left-radius: var(--elem-radius);
}

th {
border-top: 1px solid var(--border-primary);

&:last-child {
border-right: 1px solid var(--border-primary);
border-top-right-radius: var(--elem-radius);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
width: 100%;
}

.bc-table-container {
margin: 1rem 0 0;
}

.table-container-inner {
padding: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@
tr {
height: 3rem;

@media screen and (min-width: $screen-md) {
&:last-child {
th,
td {
border-bottom-width: 0;
}
}
}

th {
border-left-width: 0;
vertical-align: middle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default function BrowserCompatibilityTable({
>
Report problems with this compatibility data on GitHub
</a>
<figure className="table-container">
<figure className="table-container bc-table-container">
<figure className="table-container-inner">
<table key="bc-table" className="bc-table bc-table-web">
<Headers
Expand Down