mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°4021 - Introduce sticky header for panels and object details (tab container to be done)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/*!
|
||||
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
$ibo-panel-within-main-content--sticky-sentinel-top--top: -1 * $ibo-main-content--padding-top !default;
|
||||
$ibo-panel-within-main-content--sticky-sentinel-top--height: $ibo-main-content--padding-top !default;
|
||||
|
||||
$ibo-panel-within-main-content--header--top--is-sticky: -1 * $ibo-main-content--padding-top !default;
|
||||
|
||||
#ibo-main-content {
|
||||
/*
|
||||
* Careful: Here we get all the "descendants" instead of the first closest panel in the main content, which could cause some glitches in the future.
|
||||
* For now we decided to stay that way for the following reasons, if that changes in the future keep the repercussions on descendants panels in mind.
|
||||
* - We don't have nested sticky panels (yet)
|
||||
* - We don't want to hardcode the main content's markup selector if not necessary as it could change in the future (and is already different in read-only vs edition)
|
||||
* - Unlike in JS, there no easy way to find the closest descendant
|
||||
*/
|
||||
.ibo-panel.ibo-has-sticky-header {
|
||||
/* Stickable header rules */
|
||||
> .ibo-sticky-sentinel-top {
|
||||
top: $ibo-panel-within-main-content--sticky-sentinel-top--top;
|
||||
height: $ibo-panel-within-main-content--sticky-sentinel-top--height;
|
||||
}
|
||||
> .ibo-panel--header.ibo-is-sticking {
|
||||
top: $ibo-panel-within-main-content--header--top--is-sticky;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
css/backoffice/blocks-integrations/_panel-within-modal.scss
Normal file
24
css/backoffice/blocks-integrations/_panel-within-modal.scss
Normal file
@@ -0,0 +1,24 @@
|
||||
/*!
|
||||
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
$ibo-panel-within-modal--header--top--is-sticky: -1 * $ibo-vendors-jqueryui--ui-dialog-content--padding-y !default;
|
||||
|
||||
.ui-dialog-content {
|
||||
/*
|
||||
* Careful: Here we get all the "descendants" instead of the first closest panel in the modal, which could cause some glitches in the future.
|
||||
* For now we decided to stay that way for the following reasons, if that changes in the future keep the repercussions on descendants panels in mind.
|
||||
* - We don't have nested sticky panels (yet)
|
||||
* - We don't want to hardcode the modal's markup selector if not necessary as it could change in the future (and is already different in read-only vs edition)
|
||||
* - Unlike in JS, there no easy way to find the closest descendant
|
||||
*/
|
||||
.ibo-panel {
|
||||
/* Sticky header rules */
|
||||
> .ibo-panel--header {
|
||||
&.ibo-is-sticking {
|
||||
top: $ibo-panel-within-modal--header--top--is-sticky;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,23 +19,28 @@
|
||||
/* SCSS variables */
|
||||
$ibo-panel--spacing-top: 24px !default;
|
||||
|
||||
/* - Base variables for the block */
|
||||
$ibo-panel--base-border-size: 1px !default;
|
||||
$ibo-panel--base-border-style: solid !default;
|
||||
$ibo-panel--base-border-color: $ibo-color-grey-400 !default;
|
||||
$ibo-panel--base-border: $ibo-panel--base-border-size $ibo-panel--base-border-style $ibo-panel--base-border-color !default;
|
||||
|
||||
$ibo-panel--base-transition-property: all !default;
|
||||
$ibo-panel--base-transition-duration: 0.15s !default;
|
||||
$ibo-panel--base-transition-timing-function: linear !default;
|
||||
$ibo-panel--base-transition: $ibo-panel--base-transition-property $ibo-panel--base-transition-duration $ibo-panel--base-transition-timing-function !default;
|
||||
|
||||
%ibo-panel--base-transition {
|
||||
transition: $ibo-panel--base-transition;
|
||||
}
|
||||
|
||||
/* - Specific variables for the block */
|
||||
$ibo-panel--header--margin-bottom: 4px !default;
|
||||
|
||||
$ibo-panel--icon--size: 48px !default;
|
||||
$ibo-panel--icon--spacing: 16px !default;
|
||||
$ibo-panel--icon--size-as-medallion: 72px !default;
|
||||
$ibo-panel--icon--spacing--as-medallion: 16px !default;
|
||||
$ibo-panel--icon--bottom--as-medallion: -24px !default;
|
||||
$ibo-panel--icon--background-color--as-medallion: $ibo-color-grey-100 !default;
|
||||
$ibo-panel--icon--border--as-medallion: 2px solid $ibo-color-blue-grey-300 !default;
|
||||
$ibo-panel--icon--border-radius--as-medallion: $ibo-border-radius-full !default;
|
||||
$ibo-panel--header--background-color--is-sticking: $ibo-color-grey-100 !default;
|
||||
$ibo-panel--header--border--is-sticking: $ibo-panel--base-border !default;
|
||||
|
||||
$ibo-panel--icon-background--size--must-contain: contain !default;
|
||||
$ibo-panel--icon-background--size--must-cover: cover !default;
|
||||
$ibo-panel--icon-background--size--must-zoomout: 66.67% !default;
|
||||
|
||||
$ibo-panel--title--color: $ibo-color-grey-900 !default;
|
||||
$ibo-panel--subtitle--color: $ibo-color-grey-800 !default;
|
||||
$ibo-panel--header--padding-y--is-sticking: 4px !default;
|
||||
|
||||
$ibo-panel--highlight--width: 100% !default;
|
||||
$ibo-panel--highlight--height: 8px !default;
|
||||
@@ -47,8 +52,30 @@ $ibo-panel--body--padding-bottom: 24px !default;
|
||||
$ibo-panel--body--padding-top: $ibo-panel--body--padding-bottom + $ibo-panel--highlight--height !default;
|
||||
$ibo-panel--body--padding-x: 16px !default;
|
||||
$ibo-panel--body--border-radius: $ibo-border-radius-500 !default;
|
||||
$ibo-panel--body--border-size: 1px !default;
|
||||
$ibo-panel--body--border-color: $ibo-color-grey-400 !default;
|
||||
$ibo-panel--body--border: $ibo-panel--base-border !default;
|
||||
|
||||
$ibo-panel--icon--size: 48px !default;
|
||||
$ibo-panel--icon--spacing: 16px !default;
|
||||
$ibo-panel--icon--size-as-medallion: 72px !default;
|
||||
$ibo-panel--icon--spacing--as-medallion: 16px !default;
|
||||
$ibo-panel--icon--bottom--as-medallion: -24px !default;
|
||||
$ibo-panel--icon--background-color--as-medallion: $ibo-color-grey-100 !default;
|
||||
$ibo-panel--icon--border--as-medallion: 2px solid $ibo-color-blue-grey-300 !default;
|
||||
$ibo-panel--icon--border-radius--as-medallion: $ibo-border-radius-full !default;
|
||||
|
||||
$ibo-panel--icon--size-as-medallion--is-sticking: 48px !default;
|
||||
$ibo-panel--icon--spacing--as-medallion--is-sticking: $ibo-panel--icon--spacing--as-medallion !default;
|
||||
$ibo-panel--icon--bottom--as-medallion--is-sticking: -12px !default;
|
||||
$ibo-panel--icon--border--as-medallion--is-sticking: 1px $ibo-panel--base-border-style $ibo-panel--base-border-color !default;
|
||||
|
||||
$ibo-panel--icon-background--size--must-contain: contain !default;
|
||||
$ibo-panel--icon-background--size--must-cover: cover !default;
|
||||
$ibo-panel--icon-background--size--must-zoomout: 66.67% !default;
|
||||
|
||||
$ibo-panel--title--font-size--is-sticking: $ibo-font-size-150 !default;
|
||||
$ibo-panel--title--color: $ibo-color-grey-900 !default;
|
||||
$ibo-panel--subtitle--font-size--is-sticking: $ibo-font-size-100 !default;
|
||||
$ibo-panel--subtitle--color: $ibo-color-grey-800 !default;
|
||||
|
||||
$ibo-panel--collapsible-toggler--margin-right: 8px !default;
|
||||
$ibo-panel--collapsible-toggler--font-size: $ibo-font-size-250 !default;
|
||||
@@ -95,6 +122,8 @@ $ibo-panel-colors: (
|
||||
}
|
||||
|
||||
.ibo-panel {
|
||||
position: relative;
|
||||
|
||||
&.ibo-has-icon {
|
||||
.ibo-panel--titles {
|
||||
padding-left: $ibo-panel--icon--spacing;
|
||||
@@ -107,7 +136,7 @@ $ibo-panel-colors: (
|
||||
margin-left: $ibo-panel--icon--spacing--as-medallion;
|
||||
}
|
||||
|
||||
// Note: Direct child selector is mandatory, otherwise a panel within a panel with a medallion icon will have its icon as a medallion too (eg. dashboard in an object)
|
||||
// Note: Direct child selector is mandatory, otherwise a panel within a panel could be affected too when it shouldn't (eg. dashboard in an object, n:n panel)
|
||||
> .ibo-panel--header {
|
||||
.ibo-panel--header-left {
|
||||
.ibo-panel--icon {
|
||||
@@ -176,13 +205,13 @@ $ibo-panel-colors: (
|
||||
.ibo-panel--title {
|
||||
display: inline-block;
|
||||
color: $ibo-panel--title--color;
|
||||
@extend %ibo-font-ral-sembol-250;
|
||||
@extend %ibo-font-ral-med-350;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.ibo-panel--subtitle {
|
||||
display: flex;
|
||||
@extend %ibo-font-ral-med-250;
|
||||
@extend %ibo-font-ral-med-150;
|
||||
color: $ibo-panel--subtitle--color;
|
||||
}
|
||||
|
||||
@@ -190,7 +219,7 @@ $ibo-panel-colors: (
|
||||
position: relative;
|
||||
padding: $ibo-panel--body--padding-top $ibo-panel--body--padding-x $ibo-panel--body--padding-bottom $ibo-panel--body--padding-x;
|
||||
background-color: $ibo-panel--body--background-color;
|
||||
border: solid $ibo-panel--body--border-size $ibo-panel--body--border-color;
|
||||
border: $ibo-panel--body--border;
|
||||
border-radius: $ibo-panel--body--border-radius;
|
||||
overflow: hidden; /* To force highlight color to be cropped by the border radius */
|
||||
|
||||
@@ -226,4 +255,67 @@ $ibo-panel-colors: (
|
||||
.ibo-panel--body {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Sticky header rules */
|
||||
.ibo-panel.ibo-has-sticky-header {
|
||||
// Note: Direct child selector is mandatory, otherwise a panel within a panel could be affected too when it shouldn't (eg. dashboard in an object, n:n panel)
|
||||
> .ibo-panel--header {
|
||||
position: sticky;
|
||||
z-index: 1;
|
||||
top: 0; /* Default, stick on the top of the panel. Custom integrations should be done in the "blocks-integrations" partials */
|
||||
|
||||
/* All transitions should have a specific duration except for the header's "top" property otherwise it feels laggy */
|
||||
/* - The header itself */
|
||||
transition-property: $ibo-panel--base-transition-property, top;
|
||||
transition-duration: $ibo-panel--base-transition-duration, 0s;
|
||||
transition-timing-function: $ibo-panel--base-transition-timing-function;
|
||||
/* - Impacted descendants (we don't put "*" as it can get shaky otherwise) */
|
||||
.ibo-panel--title,
|
||||
.ibo-panel--subtitle,
|
||||
.ibo-panel--icon,
|
||||
.ibo-panel--titles{
|
||||
@extend %ibo-panel--base-transition;
|
||||
}
|
||||
|
||||
/* Transition rules */
|
||||
&.ibo-is-sticking {
|
||||
padding-top: $ibo-panel--header--padding-y--is-sticking;
|
||||
padding-bottom: $ibo-panel--header--padding-y--is-sticking;
|
||||
background-color: $ibo-panel--header--background-color--is-sticking;
|
||||
border: $ibo-panel--header--border--is-sticking;
|
||||
align-items: center;
|
||||
|
||||
.ibo-panel--title {
|
||||
font-size: $ibo-panel--title--font-size--is-sticking;
|
||||
}
|
||||
.ibo-panel--subtitle {
|
||||
font-size: $ibo-panel--subtitle--font-size--is-sticking;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&.ibo-has-icon {
|
||||
&.ibo-has-medallion-icon {
|
||||
// Note: Direct child selector is mandatory, otherwise a panel within a panel could be affected too when it shouldn't (eg. dashboard in an object, n:n panel)
|
||||
> .ibo-panel--header {
|
||||
/* Transition rules */
|
||||
&.ibo-is-sticking {
|
||||
.ibo-panel--icon {
|
||||
bottom: $ibo-panel--icon--bottom--as-medallion--is-sticking;
|
||||
width: $ibo-panel--icon--size-as-medallion--is-sticking;
|
||||
height: $ibo-panel--icon--size-as-medallion--is-sticking;
|
||||
min-width: $ibo-panel--icon--size-as-medallion--is-sticking;
|
||||
min-height: $ibo-panel--icon--size-as-medallion--is-sticking;
|
||||
border: $ibo-panel--icon--border--as-medallion--is-sticking;
|
||||
}
|
||||
.ibo-panel--titles {
|
||||
padding-left: calc(#{$ibo-panel--icon--size-as-medallion--is-sticking} + #{$ibo-panel--icon--spacing--as-medallion--is-sticking});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,9 @@ $ibo-object-details--icon--background-color--as-medallion: $ibo-color-grey-100 !
|
||||
$ibo-object-details--icon--border--as-medallion: 2px solid $ibo-color-blue-grey-300 !default;
|
||||
$ibo-object-details--icon--border-radius--as-medallion: $ibo-border-radius-full !default;
|
||||
|
||||
$ibo-object-details--icon--size--is-sticking: $ibo-panel--icon--size-as-medallion--is-sticking !default;
|
||||
$ibo-object-details--icon--spacing--as-medallion--is-sticking: $ibo-object-details--icon--spacing--as-medallion !default;
|
||||
|
||||
$ibo-object-details--status-dot--size: 10px !default;
|
||||
$ibo-object-details--status-dot--spacing: 8px !default;
|
||||
$ibo-object-details--status-dot--border-radius: $ibo-border-radius-full !default;
|
||||
@@ -48,14 +51,6 @@ $ibo-object-details--tag--separator--border-radius: $ibo-border-radius-full !def
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ibo-panel--title {
|
||||
@extend %ibo-font-ral-med-350;
|
||||
}
|
||||
|
||||
.ibo-panel--subtitle {
|
||||
@extend %ibo-font-ral-med-150;
|
||||
}
|
||||
}
|
||||
|
||||
.ibo-object-details--status {
|
||||
@@ -122,3 +117,40 @@ $ibo-object-details--tag--separator--border-radius: $ibo-border-radius-full !def
|
||||
background-color: $ibo-object-details--tag--separator--background-color;
|
||||
}
|
||||
}
|
||||
|
||||
/* Sticky header rules */
|
||||
.ibo-object-details.ibo-has-sticky-header {
|
||||
// Note: Direct child selector is mandatory, otherwise a panel within a panel could be affected too when it shouldn't (eg. dashboard in an object, n:n panel)
|
||||
> .ibo-panel--header {
|
||||
/* All transitions should have a specific duration except for the header's "top" property otherwise it feels laggy */
|
||||
/* - Impacted descendants (we don't put "*" as it can get shaky otherwise) */
|
||||
.ibo-panel--header-left {
|
||||
@extend %ibo-panel--base-transition;
|
||||
}
|
||||
|
||||
/* Transition rules */
|
||||
&.ibo-is-sticking {
|
||||
.ibo-object-details--object-class {
|
||||
display: none; /* Make space by hiding unnecessary info */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ibo-has-icon {
|
||||
&.ibo-has-medallion-icon {
|
||||
// Note: Direct child selector is mandatory, otherwise a panel within a panel with a medallion icon will have its icon as a medallion too (eg. dashboard in an object)
|
||||
> .ibo-panel--header {
|
||||
/* Transition rules */
|
||||
&.ibo-is-sticking {
|
||||
.ibo-panel--header-left {
|
||||
padding-left: $ibo-object-details--icon--size--is-sticking;
|
||||
}
|
||||
|
||||
.ibo-panel--titles {
|
||||
padding-left: $ibo-object-details--icon--spacing--as-medallion--is-sticking;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,14 @@
|
||||
$ibo-is-code--background-color: $ibo-color-white-200 !default;
|
||||
$ibo-is-code--padding: 1.25rem 1.5rem !default;
|
||||
|
||||
$ibo-sticky-sentinel--left: 0 !default;
|
||||
$ibo-sticky-sentinel--right: 0 !default;
|
||||
$ibo-sticky-sentinel--height: 0 !default;
|
||||
$ibo-sticky-sentinel-top--top: 0 !default;
|
||||
$ibo-sticky-sentinel-top--height: $ibo-sticky-sentinel--height !default;
|
||||
$ibo-sticky-sentinel-bottom--bottom: 0 !default;
|
||||
$ibo-sticky-sentinel-bottom--height: $ibo-sticky-sentinel--height !default;
|
||||
|
||||
/**************/
|
||||
/* Visibility */
|
||||
/**************/
|
||||
@@ -126,6 +134,28 @@ body.ibo-has-fullscreen-descendant {
|
||||
@extend %ibo-font-code-150;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
/* Sticky headers */
|
||||
/* */
|
||||
/* Used as a trigger to make an element stick to another during scroll */
|
||||
/***********************************************************************/
|
||||
|
||||
.ibo-sticky-sentinel {
|
||||
position: absolute;
|
||||
left: $ibo-sticky-sentinel--left;
|
||||
right: $ibo-sticky-sentinel--right;
|
||||
visibility: hidden;
|
||||
}
|
||||
.ibo-sticky-sentinel-top {
|
||||
top: $ibo-sticky-sentinel-top--top;
|
||||
height: $ibo-sticky-sentinel-top--height; /* To be overloaded by use cases */
|
||||
}
|
||||
.ibo-sticky-sentinel-bottom {
|
||||
bottom: $ibo-sticky-sentinel-bottom--bottom;
|
||||
height: $ibo-sticky-sentinel-bottom--height; /* To be overloaded by use cases */
|
||||
}
|
||||
|
||||
|
||||
%ibo-medallion {
|
||||
position: relative;
|
||||
border-radius: var(--ibo-border-radius-full);
|
||||
|
||||
Reference in New Issue
Block a user