mirror of
https://github.com/flarum/core.git
synced 2025-08-01 06:00:24 +02:00
Permission Grid: stick the headers to handle a lot of tags (#2887)
* sticky thead th & tbody th, adapt PermissionPage and PermissionGrid layout * adjust height size * cleanup * cleanup with some SychO9's recommendation * remove the `thead th` `first-child` "protection"
This commit is contained in:
@@ -17,7 +17,7 @@ export default class PermissionGrid extends Component {
|
|||||||
<table className="PermissionGrid">
|
<table className="PermissionGrid">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<th></th>
|
||||||
{scopes.map((scope) => (
|
{scopes.map((scope) => (
|
||||||
<th>
|
<th>
|
||||||
{scope.label}{' '}
|
{scope.label}{' '}
|
||||||
|
@@ -34,8 +34,9 @@
|
|||||||
|
|
||||||
|
|
||||||
.PermissionsPage-permissions {
|
.PermissionsPage-permissions {
|
||||||
padding: 20px 0 200px;
|
margin: 20px 0 30px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
max-height: 75vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.PermissionGrid {
|
.PermissionGrid {
|
||||||
@@ -49,11 +50,23 @@
|
|||||||
color: @muted-color;
|
color: @muted-color;
|
||||||
}
|
}
|
||||||
thead th {
|
thead th {
|
||||||
|
position: -webkit-sticky;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
padding-bottom: 10px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: @muted-color;
|
color: @muted-color;
|
||||||
|
background: @body-bg;
|
||||||
min-width: 140px;
|
min-width: 140px;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
left: 0;
|
||||||
|
z-index: 3;
|
||||||
|
background: @body-bg;
|
||||||
|
}
|
||||||
|
|
||||||
&:not(:hover) .PermissionGrid-removeScope {
|
&:not(:hover) .PermissionGrid-removeScope {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -61,7 +74,12 @@
|
|||||||
}
|
}
|
||||||
tbody {
|
tbody {
|
||||||
th {
|
th {
|
||||||
|
position: -webkit-sticky;
|
||||||
|
position: sticky;
|
||||||
|
left: 0;
|
||||||
padding-right: 50px;
|
padding-right: 50px;
|
||||||
|
z-index: 2;
|
||||||
|
background: inherit;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
@@ -114,17 +132,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.PermissionGrid-section {
|
.PermissionGrid-section {
|
||||||
|
background: @body-bg;
|
||||||
|
|
||||||
td, th {
|
td, th {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.PermissionGrid-child {
|
.PermissionGrid-child {
|
||||||
|
background: @body-bg;
|
||||||
|
|
||||||
td, th {
|
td, th {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
}
|
}
|
||||||
th {
|
th {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: lighten(@control-bg, 3%);
|
background: lighten(@control-bg, 3%);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user