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

WET-388 Pre-assessment for overlay #2218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
176 changes: 176 additions & 0 deletions components/overlay/_base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
/*
* Web Experience Toolkit (WET) / Boîte à outils de l'expérience Web (BOEW)
* wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
*/

/*
* Overlay base
*/
.wb-overlay {
background-clip: border-box;
background-color: $overlay-background-color;
border: 0;
border-radius: 0;
display: none;
// Push the element onto the GPU stack
transform: translateZ(0);
z-index: 1050;

&.wb-inview {
display: block;
}

&.open {
display: inline-block;
position: fixed;
}
}

%overlay-panel {
height: 100%;
max-width: 90%;
top: 0;
}

%overlay-bar {
border-bottom: 0;
left: 0;
max-height: 90%;
min-width: 100%;
}

%overlay-popup {
max-height: 90%;
max-width: 90%;
}

/*
* Overlay styles
*/
.wb-panel-l {
@extend %overlay-panel;
left: 0;
}

.wb-panel-r {
@extend %overlay-panel;
right: 0;
}

.wb-bar-t {
@extend %overlay-bar;
top: 0;
}

.wb-bar-b {
@extend %overlay-bar;
bottom: 0;
}

.wb-popup-mid {
@extend %overlay-popup;
border-radius: 6px;
bottom: 0;
left: 0;
margin: auto;
right: 0;
top: 0;
width: 90%;
}

.wb-popup-full {
height: 100%;
left: 0;
top: 0;
width: 100%;
}

.mfp-bg {
opacity: .97;
}

.wb-overlay-dlg {
overflow: hidden;

.overlay-bg {
box-shadow: 0 0 1000px 1000px black;
}
}

/*
* Overlay parts
*/
.overlay-def {
overflow-y: auto;

header {
background-color: $overlay-header-background-color;
color: $overlay-header-color;
display: block;
padding: 0 44px 0 1em;
}

.modal-title {
font-size: 1.15em;
padding: 10px 0;
}

&.wb-bar-t,
&.wb-bar-b {
background-color: $overlay-bar-background-color;
header {
background-color: $overlay-bar-background-color;
}
}

.mfp-close {
color: #fff;
}
}

.hidden-hd {
.modal-body {
padding-top: 50px;
}

.overlay-close {
&:not(.btn) {
background-color: #000;
border-radius: 999px;
height: 1em;
line-height: 1em;
margin-right: 20px;
margin-top: 10px;
width: 1em;
}
}
}

.wb-disable {
.wb-overlay {
@extend %global-display-block-important;
}
}

[dir=rtl] {
.mfp-close {
left: 0;
right: auto;
}

.wb-panel-l {
left: auto;
right: 0;
}

.wb-panel-r {
left: 0;
right: auto;
}

.overlay-def {
header {
padding: 0 1em 0 44px;
}
}
}
45 changes: 45 additions & 0 deletions components/overlay/_ie8.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Web Experience Toolkit (WET) / Boîte à outils de l'expérience Web (BOEW)
* wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
*/

/*
* Overlay base
*/
%overlay-ie8-border-left-999 {
border-left: 1px solid #999;
}

%overlay-ie8-border-right-999 {
border-right: 1px solid #999;
}

.lt-ie9 {
.wb-panel-l {
@extend %overlay-ie8-border-right-999;
}

.wb-panel-r {
@extend %overlay-ie8-border-left-999;
}

.wb-bar-t {
border-bottom: 1px solid #999;
}

.wb-bar-b {
border-top: 1px solid #999;
}

&[dir=rtl] {
.wb-panel-l {
@extend %overlay-ie8-border-left-999;
border-right: 0;
}

.wb-panel-r {
@extend %overlay-ie8-border-right-999;
border-left: 0;
}
}
}
11 changes: 11 additions & 0 deletions components/overlay/_noscript.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Web Experience Toolkit (WET) / Boîte à outils de l'expérience Web (BOEW)
* wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
*/

/*
* Overlay Sass (noscript)
*/
.wb-overlay {
@extend %noscript-display-block-important;
}
42 changes: 42 additions & 0 deletions components/overlay/_print.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Web Experience Toolkit (WET) / Boîte à outils de l'expérience Web (BOEW)
* wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
*/

/**
* Print styles
*/

.wb-overlay-dlg, .wb-modal {

main {

// Hide white spaces
> * {
display: none;
}

// Show only the dialog
.wb-overlay.open, .mfp-content {
display:block;
}
}
}

.wb-overlay {

&.open {
position: static;

&.no-print {
display: none;
}
}
}

// Show the page title
.mfp-content:before, .wb-overlay.open:before {
content: attr(data-pgtitle);
display: block;
font-size: $font-size-h1;
}
19 changes: 19 additions & 0 deletions components/overlay/demo/overlay.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Web Experience Toolkit (WET) / Boîte à outils de l'expérience Web (BOEW)
* wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
*/
/*jshint unused: false*/
( function( $, wb ) {
"use strict";

wb.doc.on( "click", "#overlay-open-btn", function( event ) {
if ( event.stopPropagation ) {
event.stopImmediatePropagation();
} else {
event.cancelBubble = true;
}

$( "#" + $( "#overlay-select" ).val() ).trigger( "open.wb-overlay" );
} );

} )( jQuery, wb );
40 changes: 40 additions & 0 deletions components/overlay/demo/overlay.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Web Experience Toolkit (WET) / Boîte à outils de l'expérience Web (BOEW)
* wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
*/
%overlay-demo-inline-block {
display: inline-block;
}

.wb-panel-l,
.wb-panel-r {
ul {
li {
margin-bottom: 10px;
}
}
}

.wb-bar-t,
.wb-bar-b {
header {
@extend %overlay-demo-inline-block;
}

ul {
@extend %overlay-demo-inline-block;
margin-bottom: 0;

li {
margin-bottom: 5px;
}

> {
li {
&:first-child {
padding-left: 5px;
}
}
}
}
}