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

Permission Grid: stick the headers to handle a lot of tags #2887

Merged
merged 8 commits into from
Aug 14, 2021
2 changes: 1 addition & 1 deletion js/src/admin/components/PermissionGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class PermissionGrid extends Component {
<table className="PermissionGrid">
<thead>
<tr>
<td></td>
<th></th>
{scopes.map((scope) => (
<th>
{scope.label}{' '}
Expand Down
26 changes: 25 additions & 1 deletion less/admin/PermissionsPage.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@


.PermissionsPage-permissions {
padding: 20px 0 200px;
margin: 20px 0 30px;
overflow-x: auto;
max-height: 75vh;
}

.PermissionGrid {
Expand All @@ -49,19 +50,36 @@
color: @muted-color;
}
thead th {
position: -webkit-sticky;
Copy link
Member

Choose a reason for hiding this comment

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

I don't suppose we can avoid vendor specific stuff here?

Copy link
Member

@SychO9 SychO9 Aug 14, 2021

Choose a reason for hiding this comment

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

for now we need it for some old safari browsers

https://caniuse.com/?search=sticky

position: sticky;
top: 0;
padding-bottom: 10px;
Ornanovitch marked this conversation as resolved.
Show resolved Hide resolved
text-transform: uppercase;
font-weight: bold;
font-size: 12px;
color: @muted-color;
background: @body-bg;
min-width: 140px;
z-index: 1;

&:first-child {
left: 0;
z-index: 3;
background: @body-bg;
}
Ornanovitch marked this conversation as resolved.
Show resolved Hide resolved

&:not(:hover) .PermissionGrid-removeScope {
display: none;
}
}
tbody {
th {
position: -webkit-sticky;
position: sticky;
left: 0;
padding-right: 50px;
z-index: 2;
background: inherit;

.icon {
margin-right: 5px;
Expand Down Expand Up @@ -114,17 +132,23 @@
}
}
.PermissionGrid-section {
background: @body-bg;

td, th {
padding-top: 10px;
}
}
.PermissionGrid-child {
background: @body-bg;

td, th {
position: relative;
z-index: 0;
}
th {
font-weight: normal;
}

&:hover {
background: lighten(@control-bg, 3%);
}
Expand Down