diff --git a/core/core.libraries.yml b/core/core.libraries.yml index e05f1b04c19874582c4ca8c883dde024582f78fb..1ba7206b108f878a3d5664f953195244c452867c 100644 --- a/core/core.libraries.yml +++ b/core/core.libraries.yml @@ -908,3 +908,31 @@ underscore: gpl-compatible: true js: assets/vendor/underscore/underscore-min.js: { weight: -20, minified: true } + +drupal.dialog.off_canvas: + version: VERSION + js: + misc/dialog/off-canvas.js: {} + css: + base: + misc/dialog/off-canvas.reset.css: {} + misc/dialog/off-canvas.base.css: {} + misc/dialog/off-canvas.css: {} + # Add group setting to make sure this CSS load before any jQuery UI Dialog + # CSS. + misc/dialog/off-canvas.theme.css: { group: 200 } + component: + misc/dialog/off-canvas.motion.css: {} + misc/dialog/off-canvas.button.css: {} + misc/dialog/off-canvas.form.css: {} + misc/dialog/off-canvas.table.css: {} + misc/dialog/off-canvas.details.css: {} + misc/dialog/off-canvas.tabledrag.css: {} + misc/dialog/off-canvas.dropbutton.css: {} + dependencies: + - core/jquery + - core/drupal + - core/drupal.ajax + - core/drupal.announce + - core/drupal.dialog + - core/drupal.dialog.ajax diff --git a/core/core.services.yml b/core/core.services.yml index 7d7ff3e336223f188bfca4ba7f1720af1139aaba..1c02e0b85d86effd4bcd734d1aa57a4ef3e6d97b 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -1048,6 +1048,11 @@ services: arguments: ['@title_resolver'] tags: - { name: render.main_content_renderer, format: drupal_dialog } + main_content_renderer.off_canvas: + class: Drupal\Core\Render\MainContent\OffCanvasRenderer + arguments: ['@title_resolver', '@renderer'] + tags: + - { name: render.main_content_renderer, format: drupal_dialog.off_canvas } main_content_renderer.modal: class: Drupal\Core\Render\MainContent\ModalRenderer arguments: ['@title_resolver'] diff --git a/core/modules/settings_tray/src/Ajax/OpenOffCanvasDialogCommand.php b/core/lib/Drupal/Core/Ajax/OpenOffCanvasDialogCommand.php similarity index 96% rename from core/modules/settings_tray/src/Ajax/OpenOffCanvasDialogCommand.php rename to core/lib/Drupal/Core/Ajax/OpenOffCanvasDialogCommand.php index c49c42e02bf8d4af59bea8664c3d1a23186e3dd6..da6a26e35a5278360e89f7a9699e33903079f8bd 100644 --- a/core/modules/settings_tray/src/Ajax/OpenOffCanvasDialogCommand.php +++ b/core/lib/Drupal/Core/Ajax/OpenOffCanvasDialogCommand.php @@ -1,15 +1,11 @@ <?php -namespace Drupal\settings_tray\Ajax; - -use Drupal\Core\Ajax\OpenDialogCommand; +namespace Drupal\Core\Ajax; /** * Defines an AJAX command to open content in a dialog in a off-canvas dialog. * * @ingroup ajax - * - * @internal */ class OpenOffCanvasDialogCommand extends OpenDialogCommand { diff --git a/core/modules/settings_tray/src/Render/MainContent/OffCanvasRenderer.php b/core/lib/Drupal/Core/Render/MainContent/OffCanvasRenderer.php similarity index 88% rename from core/modules/settings_tray/src/Render/MainContent/OffCanvasRenderer.php rename to core/lib/Drupal/Core/Render/MainContent/OffCanvasRenderer.php index 835503013f9cfb20b94fc60c5f2fb7cb29476e0a..55bf8eb7d1aef1ed582815fa915e63e0f11f904a 100644 --- a/core/modules/settings_tray/src/Render/MainContent/OffCanvasRenderer.php +++ b/core/lib/Drupal/Core/Render/MainContent/OffCanvasRenderer.php @@ -1,13 +1,12 @@ <?php -namespace Drupal\settings_tray\Render\MainContent; +namespace Drupal\Core\Render\MainContent; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Controller\TitleResolverInterface; -use Drupal\Core\Render\MainContent\DialogRenderer; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Routing\RouteMatchInterface; -use Drupal\settings_tray\Ajax\OpenOffCanvasDialogCommand; +use Drupal\Core\Ajax\OpenOffCanvasDialogCommand; use Symfony\Component\HttpFoundation\Request; /** @@ -47,7 +46,7 @@ public function renderResponse(array $main_content, Request $request, RouteMatch $content = $this->renderer->renderRoot($main_content); // Attach the library necessary for using the OpenOffCanvasDialogCommand and // set the attachments for this Ajax response. - $main_content['#attached']['library'][] = 'settings_tray/drupal.off_canvas'; + $main_content['#attached']['library'][] = 'core/drupal.dialog.off_canvas'; $response->setAttachments($main_content['#attached']); // If the main content doesn't provide a title, use the title resolver. diff --git a/core/modules/settings_tray/css/off-canvas.base.css b/core/misc/dialog/off-canvas.base.css similarity index 95% rename from core/modules/settings_tray/css/off-canvas.base.css rename to core/misc/dialog/off-canvas.base.css index aaa713dbbe01a90a04075e8d87be1fdff26eb88d..a0cb45698386f384036151d94a72dca4c2e4aed9 100644 --- a/core/modules/settings_tray/css/off-canvas.base.css +++ b/core/misc/dialog/off-canvas.base.css @@ -1,6 +1,6 @@ /** * @file - * Set base styles for the settings tray. + * Set base styles for the off-canvas dialog. */ /* Set some global attributes. */ @@ -217,18 +217,18 @@ } #drupal-off-canvas .messages--status { background-color: #f3faef; - background-image: url(../../../misc/icons/73b355/check.svg); + background-image: url(../icons/73b355/check.svg); color: #325e1c; } #drupal-off-canvas .messages--warning { background-color: #fdf8ed; - background-image: url(../../../misc/icons/e29700/warning.svg); + background-image: url(../icons/e29700/warning.svg); color: #734c00; } #drupal-off-canvas .messages--error { background-color: #fcf4f2; - background-image: url(../../../misc/icons/e32700/error.svg); + background-image: url(../icons/e32700/error.svg); color: #a51b00; } diff --git a/core/modules/settings_tray/css/off-canvas.button.css b/core/misc/dialog/off-canvas.button.css similarity index 96% rename from core/modules/settings_tray/css/off-canvas.button.css rename to core/misc/dialog/off-canvas.button.css index 2b734f8a81eaf20334c5e20ab2e9353b8865d116..1f8ed5537d4c82ba047f59825663a1531465918c 100644 --- a/core/modules/settings_tray/css/off-canvas.button.css +++ b/core/misc/dialog/off-canvas.button.css @@ -1,8 +1,8 @@ /** * @file - * Visual styling for buttons in the off canvas tray. + * Visual styling for buttons in the off-canvas dialog. * - * See seven/css/components/buttons.css + * @see seven/css/components/buttons.css */ #drupal-off-canvas button, diff --git a/core/modules/settings_tray/css/off-canvas.css b/core/misc/dialog/off-canvas.css similarity index 69% rename from core/modules/settings_tray/css/off-canvas.css rename to core/misc/dialog/off-canvas.css index d7f3258b2658ddd30570e49e24af969025992f52..52a8b9e0791aa559cf47f34ede4293bed649f1b2 100644 --- a/core/modules/settings_tray/css/off-canvas.css +++ b/core/misc/dialog/off-canvas.css @@ -1,8 +1,6 @@ /** * @file * CSS for off-canvas dialog. - * - * @todo Move CSS into core dialog library https://www.drupal.org/node/2784443. */ /* Position the off-canvas dialog container outside the right of the viewport. */ @@ -23,14 +21,14 @@ text-align: right; } -/* Position the dialog-off-canvas tray container outside the right of the viewport. */ +/* Position the off-canvas dialog container outside the right of the viewport. */ .ui-dialog-off-canvas { box-sizing: border-box; height: 100%; overflow: visible; } -/* Wrap the form that's inside the dialog-off-canvas tray. */ +/* Wrap the form that's inside the off-canvas dialog. */ .ui-dialog-off-canvas #drupal-off-canvas { padding: 0 20px; /* Prevent horizontal scrollbar. */ @@ -42,15 +40,15 @@ } /* - * Force the tray to be 100% width at the same breakpoint the dialog system uses - * to expand dialog widths. + * Force the off-canvas dialog to be 100% width at the same breakpoint the + * dialog system uses to expand dialog widths. */ @media all and (max-width: 48em) { /* 768px */ .ui-dialog.ui-dialog-off-canvas { width: 100% !important; } - /* When tray is at 100% width stop the body from scrolling */ - .js-tray-open { + /* When off-canvas dialog is at 100% width stop the body from scrolling */ + .js-off-canvas-dialog-open { height: 100%; overflow-y: hidden; } diff --git a/core/modules/settings_tray/css/off-canvas.details.css b/core/misc/dialog/off-canvas.details.css similarity index 93% rename from core/modules/settings_tray/css/off-canvas.details.css rename to core/misc/dialog/off-canvas.details.css index dcac6a5b04b05dc3efe9e4747d594cb63f4ff65a..fcd526f0b0783d631147d091e97fa4bd9cf6dfc6 100644 --- a/core/modules/settings_tray/css/off-canvas.details.css +++ b/core/misc/dialog/off-canvas.details.css @@ -1,6 +1,6 @@ /** * @file - * Visual styling for summary and details in the Settings Tray module's off canvas tray. + * Visual styling for summary and details in the off-canvas dialog. */ #drupal-off-canvas details, diff --git a/core/modules/settings_tray/css/off-canvas.dropbutton.css b/core/misc/dialog/off-canvas.dropbutton.css similarity index 98% rename from core/modules/settings_tray/css/off-canvas.dropbutton.css rename to core/misc/dialog/off-canvas.dropbutton.css index e467a4f341efdd6f2894824380fcd795b45aaff5..7211dceaf5a9a5e5983643027d17b6567b532c5f 100644 --- a/core/modules/settings_tray/css/off-canvas.dropbutton.css +++ b/core/misc/dialog/off-canvas.dropbutton.css @@ -1,6 +1,6 @@ /** * @file - * Styles for dropbuttons in the off-canvas tray. + * Styles for dropbuttons in the off-canvas dialog. */ #drupal-off-canvas .dropbutton-wrapper, @@ -241,7 +241,7 @@ content: '.'; display: block; color: transparent; - background: transparent url(../../../misc/icons/ffffff/pencil.svg) no-repeat center; + background: transparent url(../icons/ffffff/pencil.svg) no-repeat center; background-size: 14px; } diff --git a/core/modules/settings_tray/js/off-canvas.es6.js b/core/misc/dialog/off-canvas.es6.js similarity index 93% rename from core/modules/settings_tray/js/off-canvas.es6.js rename to core/misc/dialog/off-canvas.es6.js index 1cb740c3ff811a562eea42137b91d8a8c4f8da2d..0068e44e1b1fac98b2f7fbb69936abbbe4a4b314 100644 --- a/core/modules/settings_tray/js/off-canvas.es6.js +++ b/core/misc/dialog/off-canvas.es6.js @@ -1,12 +1,6 @@ /** * @file * Drupal's off-canvas library. - * - * @todo This functionality should extracted into a new core library or a part - * of the current drupal.dialog.ajax library. - * https://www.drupal.org/node/2784443 - * - * @private */ (($, Drupal, debounce, displace) => { @@ -22,13 +16,15 @@ /** * The minimum width to use body displace needs to match the width at which - * the tray will be %100 width. @see settings_tray.module.css + * the tray will be 100% width. @see core/misc/dialog/off-canvas.css + * * @type {Number} */ minDisplaceWidth: 768, /** * Wrapper used to position off-canvas dialog. + * * @type {jQuery} */ $mainCanvasWrapper: $('[data-off-canvas-main-canvas]'), @@ -38,6 +34,7 @@ * * @param {jQuery} $element * The dialog element. + * * @return {bool} * True this is currently an off-canvas dialog. */ @@ -59,16 +56,17 @@ /** * Handler fired before an off-canvas dialog has been opened. - * @param {Object} settings + * + * @param {Object} settings * Settings related to the composition of the dialog. + * * @return {undefined} */ beforeCreate({ settings, $element }) { // Clean up previous dialog event handlers. Drupal.offCanvas.removeOffCanvasEvents($element); - $('body').addClass('js-tray-open'); - settings.dialogClass += ' ui-dialog-off-canvas'; + $('body').addClass('js-off-canvas-dialog-open'); // @see http://api.jqueryui.com/position/ settings.position = { my: 'left top', @@ -85,10 +83,11 @@ /** * Handler fired after an off-canvas dialog has been closed. + * * @return {undefined} */ beforeClose({ $element }) { - $('body').removeClass('js-tray-open'); + $('body').removeClass('js-off-canvas-dialog-open'); // Remove all *.off-canvas events Drupal.offCanvas.removeOffCanvasEvents($element); @@ -97,10 +96,12 @@ /** * Handler fired when an off-canvas dialog has been opened. - * @param {jQuery} $element + * + * @param {jQuery} $element * The off-canvas dialog element. - * @param {Object} settings + * @param {Object} settings * Settings related to the composition of the dialog. + * * @return {undefined} */ afterCreate({ $element, settings }) { @@ -120,8 +121,10 @@ /** * Toggle classes based on title existence. * Called with Drupal.offCanvas.afterCreate. - * @param {Object} settings + * + * @param {Object} settings * Settings related to the composition of the dialog. + * * @return {undefined} */ render({ settings }) { diff --git a/core/modules/settings_tray/css/off-canvas.form.css b/core/misc/dialog/off-canvas.form.css similarity index 97% rename from core/modules/settings_tray/css/off-canvas.form.css rename to core/misc/dialog/off-canvas.form.css index 254b2c74e9749d776777e5666454e1552828a5c2..b47dbcc6f2b56d9f8b5dba9fc1bad80fd2a31f54 100644 --- a/core/modules/settings_tray/css/off-canvas.form.css +++ b/core/misc/dialog/off-canvas.form.css @@ -1,6 +1,6 @@ /** * @file - * Visual styling for forms in the Settings Tray module's off canvas tray. + * Visual styling for forms in the off-canvas dialog. */ #drupal-off-canvas form { diff --git a/core/modules/settings_tray/js/off-canvas.js b/core/misc/dialog/off-canvas.js similarity index 97% rename from core/modules/settings_tray/js/off-canvas.js rename to core/misc/dialog/off-canvas.js index 800fd8eb11f11611f08676a3cc9e626319b56dc9..1de5f675659b458f62d9900205605a4410e9b601 100644 --- a/core/modules/settings_tray/js/off-canvas.js +++ b/core/misc/dialog/off-canvas.js @@ -25,8 +25,7 @@ Drupal.offCanvas.removeOffCanvasEvents($element); - $('body').addClass('js-tray-open'); - settings.dialogClass += ' ui-dialog-off-canvas'; + $('body').addClass('js-off-canvas-dialog-open'); settings.position = { my: 'left top', @@ -39,7 +38,7 @@ beforeClose: function beforeClose(_ref2) { var $element = _ref2.$element; - $('body').removeClass('js-tray-open'); + $('body').removeClass('js-off-canvas-dialog-open'); Drupal.offCanvas.removeOffCanvasEvents($element); diff --git a/core/misc/dialog/off-canvas.motion.css b/core/misc/dialog/off-canvas.motion.css new file mode 100644 index 0000000000000000000000000000000000000000..2d5ea5f6ed142ef71ee919e045d5fe6e9fc50ccd --- /dev/null +++ b/core/misc/dialog/off-canvas.motion.css @@ -0,0 +1,11 @@ +/** + * @file + * Motion effects for off-canvas dialog. + * + * Motion effects are in a separate file so that they can be easily turned off + * to improve performance if desired. + */ + +.dialog-off-canvas-main-canvas { + transition: all .7s ease; +} diff --git a/core/modules/settings_tray/css/off-canvas.reset.css b/core/misc/dialog/off-canvas.reset.css similarity index 100% rename from core/modules/settings_tray/css/off-canvas.reset.css rename to core/misc/dialog/off-canvas.reset.css diff --git a/core/modules/settings_tray/css/off-canvas.table.css b/core/misc/dialog/off-canvas.table.css similarity index 96% rename from core/modules/settings_tray/css/off-canvas.table.css rename to core/misc/dialog/off-canvas.table.css index 24d2b4c0263d619affa1f13f59f85cfd3593ec8d..03efbd6326deed5a5c37e60b1ef11e0d79aac536 100644 --- a/core/modules/settings_tray/css/off-canvas.table.css +++ b/core/misc/dialog/off-canvas.table.css @@ -1,6 +1,6 @@ /** * @file - * Visual styling for tables in the Settings Tray module's off canvas tray. + * Visual styling for tables in the off-canvas dialog. */ #drupal-off-canvas table * { diff --git a/core/modules/settings_tray/css/off-canvas.tabledrag.css b/core/misc/dialog/off-canvas.tabledrag.css similarity index 94% rename from core/modules/settings_tray/css/off-canvas.tabledrag.css rename to core/misc/dialog/off-canvas.tabledrag.css index 20f97954da76f8536cc1ee64018fd3e8e39f7c4c..edeef831bc35212d3aeae70ea07adaa2f26c370d 100644 --- a/core/modules/settings_tray/css/off-canvas.tabledrag.css +++ b/core/misc/dialog/off-canvas.tabledrag.css @@ -1,6 +1,6 @@ /** * @file - * Table drag behavior for Settings Tray module. + * Table drag behavior for off-canvas dialog. * * @see tabledrag.js */ @@ -39,7 +39,7 @@ #drupal-off-canvas a.tabledrag-handle .handle { /* Use lighter drag icon against dark background. */ background-color: transparent; - background-image: url(../../../misc/icons/bebebe/move.svg); + background-image: url(../icons/bebebe/move.svg); background-repeat: no-repeat; background-position: center; height: auto; @@ -49,7 +49,7 @@ } #drupal-off-canvas .draggable a.tabledrag-handle:hover .handle, #drupal-off-canvas .draggable a.tabledrag-handle:focus .handle { - background-image: url(../../../misc/icons/787878/move.svg); + background-image: url(../icons/787878/move.svg); text-decoration: none; } #drupal-off-canvas tr td { diff --git a/core/modules/settings_tray/css/off-canvas.theme.css b/core/misc/dialog/off-canvas.theme.css similarity index 90% rename from core/modules/settings_tray/css/off-canvas.theme.css rename to core/misc/dialog/off-canvas.theme.css index 0493e3ce445eae740635b964e954fc401d64881c..e1990a7d464452b85c3dd0c8cd8a9bd297c7450f 100644 --- a/core/modules/settings_tray/css/off-canvas.theme.css +++ b/core/misc/dialog/off-canvas.theme.css @@ -15,7 +15,7 @@ z-index: 501; } -/* Style the tray header. */ +/* Style the off-canvas dialog header. */ .ui-dialog.ui-dialog-off-canvas .ui-dialog-titlebar { padding: 1em; background: #2d2d2d; @@ -30,7 +30,7 @@ visibility: hidden; } .ui-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close { - background-image: url(../../../misc/icons/bebebe/ex.svg); + background-image: url(../icons/bebebe/ex.svg); background-position: center center; background-repeat: no-repeat; background-color: transparent; @@ -40,7 +40,7 @@ transition: background .5s ease; } .ui-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close:hover { - background-image: url(../../../misc/icons/ffffff/ex.svg); + background-image: url(../icons/ffffff/ex.svg); } [dir="rtl"] .ui-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close { left: 1em; @@ -64,7 +64,7 @@ padding-right: 30px; } .ui-dialog.ui-dialog-off-canvas .ui-dialog-title:before { - background: transparent url(../../../misc/icons/ffffff/pencil.svg) no-repeat scroll center center; + background: transparent url(../icons/ffffff/pencil.svg) no-repeat scroll center center; background-size: 100% auto; content: ''; display: block; diff --git a/core/modules/settings_tray/css/off-canvas.motion.css b/core/modules/settings_tray/css/off-canvas.motion.css deleted file mode 100644 index ae261870bcffd3dec8a748d33317bc5735fa0109..0000000000000000000000000000000000000000 --- a/core/modules/settings_tray/css/off-canvas.motion.css +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @file - * Motion effects for off-canvas dialog. - * - * Motion effects are in a separate file so that they can be easily turned off - * to improve performance if desired. - * - * @todo Move motion effects file into a core Off-Canvas library and add a - * configuration option for browser rendering performance to disable this - * file: https://www.drupal.org/node/2784443. - */ - -.dialog-off-canvas__main-canvas { - transition: all .7s ease; -} diff --git a/core/modules/settings_tray/css/settings_tray.module.css b/core/modules/settings_tray/css/settings_tray.module.css index 05b5bee4dc4eaa590dbcfe9e46a4bb89fde43a3d..75ba0474aa1b971c056630aad89fea27c9650582 100644 --- a/core/modules/settings_tray/css/settings_tray.module.css +++ b/core/modules/settings_tray/css/settings_tray.module.css @@ -14,10 +14,10 @@ float: right; } -.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode a, -.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode input { +.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode a, +.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode input { pointer-events: none; } -.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode .contextual-links a { +.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode .contextual-links a { pointer-events: inherit; } diff --git a/core/modules/settings_tray/css/settings_tray.motion.css b/core/modules/settings_tray/css/settings_tray.motion.css index 03639cb1e40d6e84a5094a00dac7fc372e7d153f..aab7c1dc428fe8df4476eb41610d942b95a8aa75 100644 --- a/core/modules/settings_tray/css/settings_tray.motion.css +++ b/core/modules/settings_tray/css/settings_tray.motion.css @@ -12,8 +12,8 @@ } /* Transition the editables on the page, their contextual links and their hover states. */ -.dialog-off-canvas__main-canvas .contextual, -.dialog-off-canvas__main-canvas .js-settings-tray-edit-mode .settings-tray-editable, -.dialog-off-canvas__main-canvas.js-tray-open .js-settings-tray-edit-mode .settings-tray-editable { +.dialog-off-canvas-main-canvas .contextual, +.dialog-off-canvas-main-canvas .js-settings-tray-edit-mode .settings-tray-editable, +.dialog-off-canvas-main-canvas.js-off-canvas-dialog-open .js-settings-tray-edit-mode .settings-tray-editable { transition: all .7s ease; } diff --git a/core/modules/settings_tray/css/settings_tray.theme.css b/core/modules/settings_tray/css/settings_tray.theme.css index 9c40c74dfd9e145c87be90b1e4f0b754818151db..b8e42c1063d94fc5a08d8fa8a6873625b256e155 100644 --- a/core/modules/settings_tray/css/settings_tray.theme.css +++ b/core/modules/settings_tray/css/settings_tray.theme.css @@ -60,11 +60,11 @@ } /* Style the editables while in edit mode. */ -.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode .settings-tray-editable { +.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode .settings-tray-editable { outline: 1px dashed rgba(0,0,0,0.5); box-shadow: 0 0 0 1px rgba(255,255,255,0.7); } -.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode .settings-tray-editable:hover, -.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode .settings-tray-editable.settings-tray-active-editable { +.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode .settings-tray-editable:hover, +.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode .settings-tray-editable.settings-tray-active-editable { background-color: rgba(0,0,0,0.2); } diff --git a/core/modules/settings_tray/settings_tray.libraries.yml b/core/modules/settings_tray/settings_tray.libraries.yml index 672800d4f9abe8c437c6e7c14a904b3854d5b521..de5c82c78d55cbfbddd34c81bc89edb911593813 100644 --- a/core/modules/settings_tray/settings_tray.libraries.yml +++ b/core/modules/settings_tray/settings_tray.libraries.yml @@ -17,29 +17,3 @@ drupal.settings_tray: - core/drupal - core/jquery.once - core/drupal.ajax -drupal.off_canvas: - version: VERSION - js: - js/off-canvas.js: {} - css: - base: - css/off-canvas.reset.css: {} - css/off-canvas.base.css: {} - css/off-canvas.css: {} - css/off-canvas.theme.css: { group: 200 } - component: - css/off-canvas.motion.css: {} - css/off-canvas.button.css: {} - css/off-canvas.form.css: {} - css/off-canvas.table.css: {} - css/off-canvas.details.css: {} - css/off-canvas.tabledrag.css: {} - css/off-canvas.dropbutton.css: {} - - dependencies: - - core/jquery - - core/drupal - - core/drupal.ajax - - core/drupal.announce - - core/drupal.dialog - - core/drupal.dialog.ajax diff --git a/core/modules/settings_tray/settings_tray.module b/core/modules/settings_tray/settings_tray.module index 70174394147cf6d7ba3e2f8bc8939c896e73c0fd..af04450459057987ac65165f4ae31995486907f2 100644 --- a/core/modules/settings_tray/settings_tray.module +++ b/core/modules/settings_tray/settings_tray.module @@ -44,7 +44,7 @@ function settings_tray_contextual_links_view_alter(&$element, $items) { $element['#links']['settings-trayblock-configure']['title'] = t('Quick edit settings'); } - $element['#attached']['library'][] = 'settings_tray/drupal.off_canvas'; + $element['#attached']['library'][] = 'core/drupal.dialog.off_canvas'; } } @@ -60,26 +60,6 @@ function settings_tray_block_view_alter(array &$build) { ]; } -/** - * Implements hook_element_info_alter(). - */ -function settings_tray_element_info_alter(&$type) { - if (isset($type['page'])) { - $type['page']['#theme_wrappers']['settings_tray_page_wrapper'] = ['#weight' => -1000]; - } -} - -/** - * Implements hook_theme(). - */ -function settings_tray_theme() { - return [ - 'settings_tray_page_wrapper' => [ - 'variables' => ['children' => NULL], - ], - ]; -} - /** * Implements hook_entity_type_build(). */ diff --git a/core/modules/settings_tray/settings_tray.services.yml b/core/modules/settings_tray/settings_tray.services.yml index aeaaf57ed9fc674757426642b09abddab5bb79d7..a11a1d40759b88e764c61dc7ca45442baf668645 100644 --- a/core/modules/settings_tray/settings_tray.services.yml +++ b/core/modules/settings_tray/settings_tray.services.yml @@ -1,10 +1,4 @@ services: - main_content_renderer.off_canvas: - class: Drupal\settings_tray\Render\MainContent\OffCanvasRenderer - arguments: ['@title_resolver', '@renderer'] - tags: - - { name: render.main_content_renderer, format: drupal_dialog.off_canvas } - access_check.settings_tray.block.settings_tray_form: class: Drupal\settings_tray\Access\BlockPluginHasSettingsTrayFormAccessCheck tags: diff --git a/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css b/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css index 071afce28abfa93987793a8523873d9b595e3901..e07c95194e7b5ac71b1397032e256cd5f57eccf6 100644 --- a/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css +++ b/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css @@ -1,5 +1,5 @@ -.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode a, -.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode input { +.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode a, +.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode input { pointer-events: inherit !important; } /** diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php index d4d858eb530f88e217021d425cd8b64dba54ca17..fcfecde400dc9d8196708401e5346d247a10ed04 100644 --- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php +++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php @@ -8,6 +8,7 @@ use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationIsClassBlock; use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationNoneBlock; use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait; +use Drupal\Tests\system\FunctionalJavascript\OffCanvasTestBase; use Drupal\user\Entity\Role; /** @@ -15,7 +16,7 @@ * * @group settings_tray */ -class SettingsTrayBlockFormTest extends SettingsTrayJavascriptTestBase { +class SettingsTrayBlockFormTest extends OffCanvasTestBase { use ContextualLinkClickTrait; @@ -144,7 +145,7 @@ public function testBlocks($theme, $block_plugin, $new_page_text, $element_selec // suppressed. $this->openBlockForm("$block_selector {$element_selector}", $block_selector); $web_assert->elementTextContains('css', '.contextual-toolbar-tab button', 'Editing'); - $web_assert->elementAttributeContains('css', '.dialog-off-canvas__main-canvas', 'class', 'js-settings-tray-edit-mode'); + $web_assert->elementAttributeContains('css', '.dialog-off-canvas-main-canvas', 'class', 'js-settings-tray-edit-mode'); // Simulate press the Escape key. $this->getSession()->executeScript('jQuery("body").trigger(jQuery.Event("keyup", { keyCode: 27 }));'); $this->waitForOffCanvasToClose(); @@ -152,7 +153,7 @@ public function testBlocks($theme, $block_plugin, $new_page_text, $element_selec $this->assertEditModeDisabled(); $web_assert->elementTextContains('css', '#drupal-live-announce', 'Exited edit mode.'); $web_assert->elementTextNotContains('css', '.contextual-toolbar-tab button', 'Editing'); - $web_assert->elementAttributeNotContains('css', '.dialog-off-canvas__main-canvas', 'class', 'js-settings-tray-edit-mode'); + $web_assert->elementAttributeNotContains('css', '.dialog-off-canvas-main-canvas', 'class', 'js-settings-tray-edit-mode'); } /** @@ -277,7 +278,7 @@ protected function openBlockForm($block_selector, $contextual_link_container = ' $this->assertNotEmpty($contextual_link); // When page first loads Edit Mode is not triggered until first contextual // link is added. - $this->assertElementVisibleAfterWait('css', '.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode'); + $this->assertElementVisibleAfterWait('css', '.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode'); // Ensure that all other Ajax activity is completed. $this->assertSession()->assertWaitOnAjaxRequest(); $this->click($block_selector); @@ -414,7 +415,7 @@ protected function assertEditModeEnabled() { // The toolbar edit button should read "Editing". $web_assert->elementContains('css', static::TOOLBAR_EDIT_LINK_SELECTOR, 'Editing'); // The main canvas element should have the "js-settings-tray-edit-mode" class. - $web_assert->elementExists('css', '.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode'); + $web_assert->elementExists('css', '.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode'); } /** @@ -430,7 +431,7 @@ protected function assertEditModeDisabled() { $web_assert->elementContains('css', static::TOOLBAR_EDIT_LINK_SELECTOR, 'Edit'); // The main canvas element should NOT have the "js-settings-tray-edit-mode" // class. - $web_assert->elementNotExists('css', '.dialog-off-canvas__main-canvas.js-settings-tray-edit-mode'); + $web_assert->elementNotExists('css', '.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode'); } /** @@ -565,4 +566,15 @@ public function testValidationMessages() { } } + /** + * {@inheritdoc} + */ + protected function getTestThemes() { + // Remove 'seven' theme. Setting Tray "Edit Mode" will not work with 'seven' + // because it removes all contextual links the off-canvas dialog should. + return array_filter(parent::getTestThemes(), function ($theme) { + return $theme !== 'seven'; + }); + } + } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 13568e61c2543b1d6854c6f7fb862fb3bd81d1d5..3b3d01d11fe58e5b7188884ed92c0e369a20b918 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -276,6 +276,9 @@ function system_theme() { ], 'template' => 'entity-add-list', ], + 'off_canvas_page_wrapper' => [ + 'variables' => ['children' => NULL], + ], ]); } @@ -1523,3 +1526,12 @@ function system_query_entity_reference_alter(AlterableInterface $query) { $handler = $query->getMetadata('entity_reference_selection_handler'); $handler->entityQueryAlter($query); } + +/** + * Implements hook_element_info_alter(). + */ +function system_element_info_alter(&$type) { + if (isset($type['page'])) { + $type['page']['#theme_wrappers']['off_canvas_page_wrapper'] = ['#weight' => -1000]; + } +} diff --git a/core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig b/core/modules/system/templates/off-canvas-page-wrapper.html.twig similarity index 52% rename from core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig rename to core/modules/system/templates/off-canvas-page-wrapper.html.twig index af84f4fac2e07ed9acc091ebd12853351b4dea81..18dd48bec3d8e2b0ae18d675198e7282ca8c82c2 100644 --- a/core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig +++ b/core/modules/system/templates/off-canvas-page-wrapper.html.twig @@ -5,13 +5,13 @@ * * For consistent wrapping to {{ page }} render in all themes. The * "data-off-canvas-main-canvas" attribute is required by the off-canvas dialog. - * This is used by the settings_tray/drupal.off_canvas library to select the - * "main canvas" page element as opposed to the "off canvas" which is the tray + * This is used by the core/drupal.dialog.off_canvas library to select the + * "main canvas" page element as opposed to the "off canvas" which is the dialog * itself. The "main canvas" element must be resized according to the width of - * the "off canvas" tray so that no portion of the "main canvas" is obstructed - * by the tray. The tray can vary in width when opened and can be resized by the - * user. The "data-off-canvas-main-canvas" attribute cannot be removed without - * breaking the off-canvas dialog functionality. + * the "off canvas" dialog so that no portion of the "main canvas" is obstructed + * by the off-canvas dialog. The off-canvas dialog can vary in width when opened + * and can be resized by the user. The "data-off-canvas-main-canvas" attribute + * cannot be removed without breaking the off-canvas dialog functionality. * * Available variables: * - children: Contains the child elements of the page. @@ -20,7 +20,7 @@ */ #} {% if children %} - <div class="dialog-off-canvas__main-canvas" data-off-canvas-main-canvas > + <div class="dialog-off-canvas-main-canvas" data-off-canvas-main-canvas> {{ children }} </div> {% endif %} diff --git a/core/modules/settings_tray/tests/modules/off_canvas_test/off_canvas_test.info.yml b/core/modules/system/tests/modules/off_canvas_test/off_canvas_test.info.yml similarity index 75% rename from core/modules/settings_tray/tests/modules/off_canvas_test/off_canvas_test.info.yml rename to core/modules/system/tests/modules/off_canvas_test/off_canvas_test.info.yml index f6cd53947ccd8ea353db1de690ef32535d2fa02e..9680b1842d9c19bbb8e59bd4157457b7af2e9838 100644 --- a/core/modules/settings_tray/tests/modules/off_canvas_test/off_canvas_test.info.yml +++ b/core/modules/system/tests/modules/off_canvas_test/off_canvas_test.info.yml @@ -4,6 +4,3 @@ description: 'Provides off-canvas test links.' package: Testing version: VERSION core: 8.x -dependencies: - - block - - settings_tray diff --git a/core/modules/settings_tray/tests/modules/off_canvas_test/off_canvas_test.routing.yml b/core/modules/system/tests/modules/off_canvas_test/off_canvas_test.routing.yml similarity index 100% rename from core/modules/settings_tray/tests/modules/off_canvas_test/off_canvas_test.routing.yml rename to core/modules/system/tests/modules/off_canvas_test/off_canvas_test.routing.yml diff --git a/core/modules/settings_tray/tests/modules/off_canvas_test/src/Controller/TestController.php b/core/modules/system/tests/modules/off_canvas_test/src/Controller/TestController.php similarity index 87% rename from core/modules/settings_tray/tests/modules/off_canvas_test/src/Controller/TestController.php rename to core/modules/system/tests/modules/off_canvas_test/src/Controller/TestController.php index 3658bfd699a9a03c56fe951867197dd903f34f69..ea310fa0bdf8291132cc373924b88310d0cd78f5 100644 --- a/core/modules/settings_tray/tests/modules/off_canvas_test/src/Controller/TestController.php +++ b/core/modules/system/tests/modules/off_canvas_test/src/Controller/TestController.php @@ -53,11 +53,6 @@ public function linksDisplay() { 'data-dialog-type' => 'dialog', 'data-dialog-renderer' => 'off_canvas', ], - '#attached' => [ - 'library' => [ - 'settings_tray/drupal.settings_tray', - ], - ], ], 'off_canvas_link_2' => [ '#title' => 'Click Me 2!', @@ -71,11 +66,6 @@ public function linksDisplay() { 'width' => 555, ]), ], - '#attached' => [ - 'library' => [ - 'settings_tray/drupal.settings_tray', - ], - ], ], 'other_dialog_links' => [ '#title' => 'Display more links!', @@ -86,10 +76,10 @@ public function linksDisplay() { 'data-dialog-type' => 'dialog', 'data-dialog-renderer' => 'off_canvas', ], - '#attached' => [ - 'library' => [ - 'settings_tray/drupal.settings_tray', - ], + ], + '#attached' => [ + 'library' => [ + 'core/drupal.dialog.ajax', ], ], ]; @@ -129,11 +119,6 @@ public function otherDialogLinks() { ], ], ], - '#attached' => [ - 'library' => [ - 'settings_tray/drupal.settings_tray', - ], - ], ]; } diff --git a/core/modules/settings_tray/tests/src/Functional/OffCanvasDialogTest.php b/core/modules/system/tests/src/Functional/Ajax/OffCanvasDialogTest.php similarity index 89% rename from core/modules/settings_tray/tests/src/Functional/OffCanvasDialogTest.php rename to core/modules/system/tests/src/Functional/Ajax/OffCanvasDialogTest.php index bebfccfda38ec0a2fdfae73ee73b231ab1a799c6..222ebc45d7337da3acb515f20eb79273fc57eed8 100644 --- a/core/modules/settings_tray/tests/src/Functional/OffCanvasDialogTest.php +++ b/core/modules/system/tests/src/Functional/Ajax/OffCanvasDialogTest.php @@ -1,6 +1,6 @@ <?php -namespace Drupal\Tests\settings_tray\Functional; +namespace Drupal\Tests\system\Functional\Ajax; use Drupal\ajax_test\Controller\AjaxTestController; use Drupal\Component\Serialization\Json; @@ -10,7 +10,7 @@ /** * Performs tests on opening and manipulating dialogs via AJAX commands. * - * @group settings_tray + * @group Ajax */ class OffCanvasDialogTest extends BrowserTestBase { @@ -19,13 +19,12 @@ class OffCanvasDialogTest extends BrowserTestBase { * * @var array */ - public static $modules = ['ajax_test', 'settings_tray']; + public static $modules = ['ajax_test']; /** * Test sending AJAX requests to open and manipulate off-canvas dialog. */ public function testDialog() { - $this->drupalLogin($this->drupalCreateUser(['administer contact forms'])); // Ensure the elements render without notices or exceptions. $this->drupalGet('ajax-test/dialog'); diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/OffCanvasTest.php b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php similarity index 78% rename from core/modules/settings_tray/tests/src/FunctionalJavascript/OffCanvasTest.php rename to core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php index 347eaeaea9e0d630d1f2c3344d7758cef44aa695..567919c3ee7a01c17f20965d29703230d14a77b0 100644 --- a/core/modules/settings_tray/tests/src/FunctionalJavascript/OffCanvasTest.php +++ b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php @@ -1,22 +1,18 @@ <?php -namespace Drupal\Tests\settings_tray\FunctionalJavascript; +namespace Drupal\Tests\system\FunctionalJavascript; /** * Tests the off-canvas dialog functionality. * * @group settings_tray */ -class OffCanvasTest extends SettingsTrayJavascriptTestBase { +class OffCanvasTest extends OffCanvasTestBase { /** * {@inheritdoc} */ public static $modules = [ - 'block', - 'system', - 'toolbar', - 'settings_tray', 'off_canvas_test', ]; @@ -48,7 +44,7 @@ public function testOffCanvasLinks() { $web_assert->elementExists('css', '#drupal-off-canvas'); // Check that response text is on page. $web_assert->pageTextContains("Thing $link_index says hello"); - $off_canvas_tray = $this->getTray(); + $off_canvas_tray = $this->getOffCanvasDialog(); // Check that tray is visible. $this->assertEquals(TRUE, $off_canvas_tray->isVisible()); @@ -94,30 +90,21 @@ public function testNarrowWidth() { // Testing at the wider width. $this->getSession()->resizeWindow($narrow_width_breakpoint + $offset, $height); $this->drupalGet('/off-canvas-test-links'); - $this->assertFalse($page->find('css', '.dialog-off-canvas__main-canvas')->hasAttribute('style'), 'Body not padded on wide page load.'); + $this->assertFalse($page->find('css', '.dialog-off-canvas-main-canvas')->hasAttribute('style'), 'Body not padded on wide page load.'); $page->clickLink("Click Me 1!"); $this->waitForOffCanvasToOpen(); // Check that the main canvas is padded when page is not narrow width and // tray is open. - $web_assert->elementAttributeContains('css', '.dialog-off-canvas__main-canvas', 'style', 'padding-right'); + $web_assert->elementAttributeContains('css', '.dialog-off-canvas-main-canvas', 'style', 'padding-right'); // Testing at the narrower width. $this->getSession()->resizeWindow($narrow_width_breakpoint - $offset, $height); $this->drupalGet('/off-canvas-test-links'); - $this->assertFalse($page->find('css', '.dialog-off-canvas__main-canvas')->hasAttribute('style'), 'Body not padded on narrow page load.'); + $this->assertFalse($page->find('css', '.dialog-off-canvas-main-canvas')->hasAttribute('style'), 'Body not padded on narrow page load.'); $page->clickLink("Click Me 1!"); $this->waitForOffCanvasToOpen(); - $this->assertFalse($page->find('css', '.dialog-off-canvas__main-canvas')->hasAttribute('style'), 'Body not padded on narrow page with tray open.'); + $this->assertFalse($page->find('css', '.dialog-off-canvas-main-canvas')->hasAttribute('style'), 'Body not padded on narrow page with tray open.'); } } - /** - * {@inheritdoc} - */ - protected function getTestThemes() { - // Add 'seven' theme. Setting Tray "Edit Mode" will not work with 'seven' - // because it removes all contextual links the off-canvas dialog should. - return array_merge(parent::getTestThemes(), ['seven']); - } - } diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayJavascriptTestBase.php b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php similarity index 80% rename from core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayJavascriptTestBase.php rename to core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php index 6dd026c5ca085ea41249dc6c60f1e06105e2f651..d3f446cf6a23d12ebd9cd9af38cfb0054fdc8b32 100644 --- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayJavascriptTestBase.php +++ b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php @@ -1,13 +1,13 @@ <?php -namespace Drupal\Tests\settings_tray\FunctionalJavascript; +namespace Drupal\Tests\system\FunctionalJavascript; use Drupal\FunctionalJavascriptTests\JavascriptTestBase; /** - * Base class contains common test functionality for the Settings Tray module. + * Base class contains common test functionality for the Off-canvas dialog. */ -abstract class SettingsTrayJavascriptTestBase extends JavascriptTestBase { +abstract class OffCanvasTestBase extends JavascriptTestBase { /** * {@inheritdoc} @@ -63,6 +63,9 @@ protected function enableTheme($theme) { */ protected function waitForOffCanvasToOpen() { $web_assert = $this->assertSession(); + // Wait just slightly longer than the off-canvas dialog CSS animation. + // @see core/misc/dialog/off-canvas.motion.css + $this->getSession()->wait(800); $web_assert->assertWaitOnAjaxRequest(); $this->assertElementVisibleAfterWait('css', '#drupal-off-canvas'); } @@ -79,10 +82,10 @@ protected function waitForOffCanvasToClose() { * * @return \Behat\Mink\Element\NodeElement|null */ - protected function getTray() { - $tray = $this->getSession()->getPage()->find('css', '.ui-dialog[aria-describedby="drupal-off-canvas"]'); - $this->assertEquals(FALSE, empty($tray), 'The tray was found.'); - return $tray; + protected function getOffCanvasDialog() { + $off_canvas_dialog = $this->getSession()->getPage()->find('css', '.ui-dialog[aria-describedby="drupal-off-canvas"]'); + $this->assertEquals(FALSE, empty($off_canvas_dialog), 'The off-canvas dialog was found.'); + return $off_canvas_dialog; } /** @@ -92,6 +95,8 @@ protected function getTray() { * CSS selector. * @param int $timeout * (optional) Timeout in milliseconds, defaults to 10000. + * + * @todo Remove in https://www.drupal.org/node/2892440. */ protected function waitForNoElement($selector, $timeout = 10000) { $condition = "(typeof jQuery !== 'undefined' && jQuery('$selector').length === 0)"; @@ -105,7 +110,7 @@ protected function waitForNoElement($selector, $timeout = 10000) { * Theme names to test. */ protected function getTestThemes() { - return ['bartik', 'stark', 'classy', 'stable']; + return ['bartik', 'stark', 'classy', 'stable', 'seven']; } /** diff --git a/core/modules/settings_tray/tests/src/Unit/Ajax/OpenOffCanvasDialogCommandTest.php b/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php similarity index 81% rename from core/modules/settings_tray/tests/src/Unit/Ajax/OpenOffCanvasDialogCommandTest.php rename to core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php index 5985cbdaf7920af402a4438b314309ad00e7dee9..e2d933a6577d6e1a563efec19ecbf37038c2582e 100644 --- a/core/modules/settings_tray/tests/src/Unit/Ajax/OpenOffCanvasDialogCommandTest.php +++ b/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php @@ -1,13 +1,13 @@ <?php -namespace Drupal\Tests\settings_tray\Unit\Ajax; +namespace Drupal\Tests\Core\Ajax; -use Drupal\settings_tray\Ajax\OpenOffCanvasDialogCommand; +use Drupal\Core\Ajax\OpenOffCanvasDialogCommand; use Drupal\Tests\UnitTestCase; /** - * @coversDefaultClass \Drupal\settings_tray\Ajax\OpenOffCanvasDialogCommand - * @group settings_tray + * @coversDefaultClass \Drupal\Core\Ajax\OpenOffCanvasDialogCommand + * @group Ajax */ class OpenOffCanvasDialogCommandTest extends UnitTestCase { diff --git a/core/themes/stable/css/core/dialog/off-canvas.base.css b/core/themes/stable/css/core/dialog/off-canvas.base.css new file mode 100644 index 0000000000000000000000000000000000000000..3c4964600300fb71287a764c5d01b85b37f5878c --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.base.css @@ -0,0 +1,238 @@ +/** + * @file + * Set base styles for the off-canvas dialog. + */ + +/* Set some global attributes. */ +#drupal-off-canvas *, +#drupal-off-canvas *:not(div) { + background: #444; + font-family: "Lucida Grande", 'Lucida Sans Unicode', 'liberation sans', sans-serif; + color: #ddd; +} + +/* Generic elements. */ +#drupal-off-canvas a, +#drupal-off-canvas .link { + border-bottom: none; + font-family: "Lucida Grande", 'Lucida Sans Unicode', 'liberation sans', sans-serif; + font-size: inherit; + font-weight: normal; + color: #85bef4; + text-decoration: none; + transition: color .5s ease; +} + +#drupal-off-canvas a:focus, +#drupal-off-canvas .link:focus, +#drupal-off-canvas a:hover, +#drupal-off-canvas .link:hover { + outline: none; + color: #46a0f5; +} +#drupal-off-canvas hr { + height: 1px; + background: #cccccc; +} +#drupal-off-canvas summary, +#drupal-off-canvas .fieldgroup:not(.form-composite) > legend { + font-weight: bold; +} +#drupal-off-canvas h1, +#drupal-off-canvas .heading-a { + display: block; + font-weight: bold; + font-size: 1.625em; + line-height: 1.875em; +} +#drupal-off-canvas h2, +#drupal-off-canvas .heading-b { + display: block; + font-weight: bold; + margin: 10px 0; + font-size: 1.385em; +} +#drupal-off-canvas h3, +#drupal-off-canvas .heading-c { + display: block; + font-weight: bold; + margin: 10px 0; + font-size: 1.231em; +} +#drupal-off-canvas h4, +#drupal-off-canvas .heading-d { + display: block; + font-weight: bold; + margin: 10px 0; + font-size: 1.154em; +} +#drupal-off-canvas h5, +#drupal-off-canvas .heading-e { + display: block; + font-weight: bold; + margin: 10px 0; + font-size: 1.077em; +} +#drupal-off-canvas h6, +#drupal-off-canvas .heading-f { + display: block; + font-weight: bold; + margin: 10px 0; + font-size: 1.077em; +} +#drupal-off-canvas p { + margin: 1em 0; +} +#drupal-off-canvas dl { + margin: 0 0 20px; +} +#drupal-off-canvas dl dd, +#drupal-off-canvas dl dl { + margin-left: 20px; /* LTR */ + margin-bottom: 10px; +} +[dir="rtl"] #drupal-off-canvas dl dd, +[dir="rtl"] #drupal-off-canvas dl dl { + margin-right: 20px; +} +#drupal-off-canvas blockquote { + margin: 1em 40px; +} +#drupal-off-canvas address { + font-style: italic; +} +#drupal-off-canvas u, +#drupal-off-canvas ins { + text-decoration: underline; +} +#drupal-off-canvas s, +#drupal-off-canvas strike, +#drupal-off-canvas del { + text-decoration: line-through; +} +#drupal-off-canvas big { + font-size: larger; +} +#drupal-off-canvas small { + font-size: smaller; +} +#drupal-off-canvas sub { + vertical-align: sub; + font-size: smaller; + line-height: normal; +} +#drupal-off-canvas sup { + vertical-align: super; + font-size: smaller; + line-height: normal; +} +#drupal-off-canvas nobr { + white-space: nowrap; +} +#drupal-off-canvas abbr, +#drupal-off-canvas acronym { + border-bottom: dotted 1px; + background: transparent; +} + +#drupal-off-canvas ul { + list-style-type: disc; + list-style-image: none; +} +[dir="rtl"] #drupal-off-canvas .messages__list { + margin-right: 0; +} +#drupal-off-canvas ol { + list-style-type: decimal; +} +#drupal-off-canvas ul li, +#drupal-off-canvas ol li { + display: block; +} +#drupal-off-canvas quote, +#drupal-off-canvas code { + margin: 20px 0; +} +#drupal-off-canvas pre { + margin: 20px 0; + white-space: pre-wrap; +} + +/* Classes for hidden and visually hidden elements. See hidden.module.css. */ +#drupal-off-canvas .hidden { + display: none; +} +#drupal-off-canvas .visually-hidden { + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); + overflow: hidden; + height: 1px; + width: 1px; + word-wrap: normal; +} +#drupal-off-canvas .visually-hidden.focusable:active, +#drupal-off-canvas .visually-hidden.focusable:focus { + position: static !important; + clip: auto; + overflow: visible; + height: auto; + width: auto; +} +#drupal-off-canvas .invisible { + visibility: hidden; +} + +/* Some system classes. See system.admin.css. */ +#drupal-off-canvas .panel { + padding: 5px 5px 15px; +} +#drupal-off-canvas .panel__description { + margin: 0 0 3px; + padding: 2px 0 3px 0; +} +#drupal-off-canvas .compact-link { + margin: 0 0 10px 0; +} +#drupal-off-canvas small .admin-link:before { + content: ' ['; +} +#drupal-off-canvas small .admin-link:after { + content: ']'; +} + +/* Override jQuery UI */ +#drupal-off-canvas .ui-widget-content a { + color: #85bef4 !important; +} + +/* Message styles */ +#drupal-off-canvas .messages { + background: no-repeat 10px 17px; +} +[dir="rtl"] #drupal-off-canvas .messages { + background-position: right 10px top 17px; +} +#drupal-off-canvas .messages abbr { + color: #444; +} +#drupal-off-canvas .messages--status { + background-color: #f3faef; + background-image: url(../../../images/core/icons/73b355/check.svg); + color: #325e1c; +} +#drupal-off-canvas .messages--warning { + background-color: #fdf8ed; + background-image: url(../../../images/core/icons/e29700/warning.svg); + color: #734c00; +} + +#drupal-off-canvas .messages--error { + background-color: #fcf4f2; + background-image: url(../../../images/core/icons/e32700/error.svg); + color: #a51b00; +} + +#drupal-off-canvas .messages--error div[role="alert"] { + background: transparent; + color: inherit; +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.button.css b/core/themes/stable/css/core/dialog/off-canvas.button.css new file mode 100644 index 0000000000000000000000000000000000000000..1f8ed5537d4c82ba047f59825663a1531465918c --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.button.css @@ -0,0 +1,118 @@ +/** + * @file + * Visual styling for buttons in the off-canvas dialog. + * + * @see seven/css/components/buttons.css + */ + +#drupal-off-canvas button, +#drupal-off-canvas .button { + -webkit-appearance: none; + -moz-appearance: none; + margin: 0 0 10px; + padding: 0; + border: 0; + box-shadow: none; + font-family: "Lucida Grande", 'Lucida Sans Unicode', 'liberation sans', sans-serif; + line-height: normal; + text-transform: none; + text-decoration: none; + cursor: pointer; +} +#drupal-off-canvas button.link { + display: inline; + background: transparent; + font-size: 14px; + color: #85bef4; + transition: color .5s ease; +} +#drupal-off-canvas button.link:hover, +#drupal-off-canvas button.link:focus { + color: #46a0f5; + text-decoration: none; +} +#drupal-off-canvas input[type="submit"].button { + display: inline-block; + position: relative; + width: 100%; + height: auto; + padding: 4px 20px; + border: 0; + border-radius: 20em; + background: #777; + font-weight: 600; + font-size: 14px; + color: #f5f5f5; + text-align: center; + cursor: pointer; + transition: background .5s ease; +} +#drupal-off-canvas input[type="submit"].button:hover, +#drupal-off-canvas input[type="submit"].button:focus, +#drupal-off-canvas input[type="submit"].button:active { + border: 0; + color: #fff; + text-decoration: none; + outline: none; + z-index: 10; +} +#drupal-off-canvas input[type="submit"].button:focus, +#drupal-off-canvas input[type="submit"].button:active { + box-shadow: 0 3px 3px 2px rgba(0,0,0,0.1); +} +#drupal-off-canvas input[type="submit"].button--primary { + border: 0; + background: #277abd; + color: #fff; + margin-top: 15px; +} +#drupal-off-canvas input[type="submit"].button--primary:hover, +#drupal-off-canvas input[type="submit"].button--primary:focus, +#drupal-off-canvas input[type="submit"].button--primary:active { + background: #2b8bd8; + outline: none; +} +#drupal-off-canvas .button-action:before { + margin-left: -0.2em; /* LTR */ + padding-right: 0.2em; /* LTR */ + font-size: 14px; + line-height: 16px; +} +[dir="rtl"] #drupal-off-canvas .button-action:before { + margin-right: -0.2em; + margin-left: 0; + padding-right: 0; + padding-left: 0.2em; +} +#drupal-off-canvas .no-touchevents .button--small { + font-size: 13px; + padding: 2px 1em; +} +#drupal-off-canvas .button:disabled, +#drupal-off-canvas .button:disabled:active, +#drupal-off-canvas .button.is-disabled, +#drupal-off-canvas .button.is-disabled:active { + border: 0; + background: #555; + color: #5c5c5c; + font-weight: normal; + cursor: default; +} +#drupal-off-canvas .button--danger { + border-radius: 0; + color: #c72100; + font-weight: 400; + text-decoration: none; +} +#drupal-off-canvas .button--danger:hover, +#drupal-off-canvas .button--danger:focus, +#drupal-off-canvas .button--danger:active { + color: #ff2a00; + text-decoration: none; + text-shadow: none; +} +#drupal-off-canvas .button--danger:disabled, +#drupal-off-canvas .button--danger.is-disabled { + color: #737373; + cursor: default; +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.css b/core/themes/stable/css/core/dialog/off-canvas.css new file mode 100644 index 0000000000000000000000000000000000000000..52a8b9e0791aa559cf47f34ede4293bed649f1b2 --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.css @@ -0,0 +1,55 @@ +/** + * @file + * CSS for off-canvas dialog. + */ + +/* Position the off-canvas dialog container outside the right of the viewport. */ +.ui-dialog-off-canvas { + box-sizing: border-box; + height: 100%; + overflow: visible; +} + +/* Wrap the form that's inside the off-canvas dialog. */ +.ui-dialog-off-canvas .ui-dialog-content { + padding: 0 20px; + /* Prevent horizontal scrollbar. */ + overflow-x: hidden; + overflow-y: auto; +} +[dir="rtl"] .ui-dialog-off-canvas .ui-dialog-content { + text-align: right; +} + +/* Position the off-canvas dialog container outside the right of the viewport. */ +.ui-dialog-off-canvas { + box-sizing: border-box; + height: 100%; + overflow: visible; +} + +/* Wrap the form that's inside the off-canvas dialog. */ +.ui-dialog-off-canvas #drupal-off-canvas { + padding: 0 20px; + /* Prevent horizontal scrollbar. */ + overflow-x: hidden; + overflow-y: auto; +} +[dir="rtl"] .ui-dialog-off-canvas #drupal-off-canvas { + text-align: right; +} + +/* + * Force the off-canvas dialog to be 100% width at the same breakpoint the + * dialog system uses to expand dialog widths. + */ +@media all and (max-width: 48em) { /* 768px */ + .ui-dialog.ui-dialog-off-canvas { + width: 100% !important; + } + /* When off-canvas dialog is at 100% width stop the body from scrolling */ + .js-off-canvas-dialog-open { + height: 100%; + overflow-y: hidden; + } +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.details.css b/core/themes/stable/css/core/dialog/off-canvas.details.css new file mode 100644 index 0000000000000000000000000000000000000000..fcd526f0b0783d631147d091e97fa4bd9cf6dfc6 --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.details.css @@ -0,0 +1,61 @@ +/** + * @file + * Visual styling for summary and details in the off-canvas dialog. + */ + +#drupal-off-canvas details, +#drupal-off-canvas summary { + display: block; + font-family: "Lucida Grande", 'Lucida Sans Unicode', 'liberation sans', sans-serif; +} +#drupal-off-canvas details, +#drupal-off-canvas summary, +#drupal-off-canvas .ui-dialog-content { + background: #474747; + color: #ddd; +} +#drupal-off-canvas summary a { + color: #ddd; + padding-top: 0; + padding-bottom: 0; +} +#drupal-off-canvas summary a:hover, +#drupal-off-canvas summary a:focus { + color: #fff; +} +#drupal-off-canvas details, +#drupal-off-canvas summary, +#drupal-off-canvas .details-wrapper { + border-width: 0; + /* Cancel out the padding of the parent. */ + margin: 0 -20px; + padding: 0 20px; +} +#drupal-off-canvas summary { + text-shadow: none; + padding: 10px 20px; + font-size: 14px; + transition: all .5s ease; +} +#drupal-off-canvas summary:hover, +#drupal-off-canvas summary:focus { + background-color: #222; + outline: none; +} +#drupal-off-canvas details[open] { + padding-bottom: 10px; +} +#drupal-off-canvas details[open] > summary { + background-color: #333; + color: #eee; +} +#drupal-off-canvas details[open] > summary:hover { + background-color: #222; + color: #fff; +} +#drupal-off-canvas details .placeholder { + font: inherit; + color: inherit; + font-style: italic; + background: transparent; +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.dropbutton.css b/core/themes/stable/css/core/dialog/off-canvas.dropbutton.css new file mode 100644 index 0000000000000000000000000000000000000000..99f5c61a9d912b8cf6b639f8565b77d471951146 --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.dropbutton.css @@ -0,0 +1,291 @@ +/** + * @file + * Styles for dropbuttons in the off-canvas dialog. + */ + +#drupal-off-canvas .dropbutton-wrapper, +#drupal-off-canvas .dropbutton-widget { + -webkit-appearance: none; + -moz-appearance: none; + display: block; + position: static; + transition: none; +} +#drupal-off-canvas .dropbutton-widget { + margin: 0; + padding: 0; + border: 0; + background: #277abd; + border-radius: 1em; + font-weight: 600; + color: #fff; + text-transform: none; + text-decoration: none; + text-align: center; + line-height: normal; + cursor: pointer; + transition: background .5s ease; +} +#drupal-off-canvas .dropbutton-widget:hover { + background: #2b8bd8; +} + +/* + * Style dropbutton single. + */ + +#drupal-off-canvas .dropbutton-single .dropbutton-action a { + padding: 0; + /* Overlap icon for trigger. */ + margin-top: -2em; + height: 2.2em; + cursor: pointer; +} +#drupal-off-canvas .dropbutton-single .dropbutton-action:hover, +#drupal-off-canvas .dropbutton-single .dropbutton-action:focus, +#drupal-off-canvas .dropbutton-single .dropbutton-action a:hover, +#drupal-off-canvas .dropbutton-single .dropbutton-action a:focus { + text-decoration: none; + outline: none; +} +#drupal-off-canvas .dropbutton-widget .dropbutton { + margin: 0; + overflow: hidden; + padding: 0; +} +#drupal-off-canvas .dropbutton li, +#drupal-off-canvas .dropbutton a { + display: block; + width: auto; + padding: 4px 0; + text-align: left; + color: #555; + outline: none; +} +#drupal-off-canvas .dropbutton li:hover, +#drupal-off-canvas .dropbutton li:focus, +#drupal-off-canvas .dropbutton a:hover, +#drupal-off-canvas .dropbutton a:focus { + background: transparent; + color: #333; + outline: none; +} + +/* + * Style dropbutton multiple. + */ + +#drupal-off-canvas .dropbutton-multiple .dropbutton-widget { + width: 2em; + height: 2em; +} +#drupal-off-canvas .dropbutton-multiple .dropbutton-widget:hover { + background-color: #2b8bd8; +} + +/* Hide the other actions until the dropbutton is triggered. */ +#drupal-off-canvas .dropbutton-multiple .dropbutton .secondary-action { + display: none; +} + +/* The toggle to expand the button. */ +#drupal-off-canvas .dropbutton-toggle { + position: absolute; + top: 0; + right: 0; /* LTR */ + bottom: 0; + display: block; + width: 2em; + color: #fff; + text-indent: 110%; + white-space: nowrap; +} +#drupal-off-canvas .dropbutton-toggle button { + display: block; + height: 100%; + width: 100%; + margin: 0; + padding: 0; + border: 0 solid transparent; + border-bottom-right-radius: 1em; /* LTR */ + border-top-right-radius: 1em; /* LTR */ + cursor: pointer; +} +#drupal-off-canvas .dropbutton-toggle button:hover, +#drupal-off-canvas .dropbutton-toggle button:focus { + outline: none; +} + +/* The toggle arrow. */ +#drupal-off-canvas .dropbutton-arrow { + position: absolute; + display: block; + height: 0; + width: 0; + margin-top: 0; + border-bottom-color: transparent; + border-left-color: transparent; + border-right-color: transparent; + border-style: solid; + border-width: 0.3333em 0.3333em 0; + color: #fff; + line-height: 0; + overflow: hidden; +} +#drupal-off-canvas span.dropbutton-arrow { + top: 7px; + right: 7px; /* LTR */ + background: transparent; +} +#drupal-off-canvas span.dropbutton-arrow:hover { + background: transparent; +} + +#drupal-off-canvas .dropbutton-action > .js-form-submit.form-submit, +#drupal-off-canvas .dropbutton-toggle button { + position: relative; + text-shadow: none; +} + +/* + * Dropbuttons when in a table cell. + */ + +/* Make sure table cell doesn't collapse around absolute positioned dropbutton. */ +#drupal-off-canvas td .dropbutton-single { + min-width: 2em; +} +#drupal-off-canvas td .dropbutton-multiple { + min-width: 2em; + padding-right: 0; + padding-left: 0; + margin-right: 0; + margin-left: 0; + border: 0; +} +#drupal-off-canvas td .dropbutton-multiple .dropbutton-action a, +#drupal-off-canvas td .dropbutton-multiple .dropbutton-action input, +#drupal-off-canvas td .dropbutton-multiple .dropbutton-action button { + width: auto; + padding: 0; + font-size: inherit; +} +#drupal-off-canvas td .dropbutton-wrapper { + margin-bottom: 0; +} + +/* Push the widget to the right so text expands left. */ +#drupal-off-canvas td .dropbutton-widget { + position: absolute; + right: 12px; /* LTR */ + padding: 0; + background: #277abd none; +} + +/* Push the wrapper to the right edge of the td. */ +#drupal-off-canvas td .dropbutton-single, +#drupal-off-canvas td .dropbutton-multiple { + float: right; /* LTR */ + padding-right: 0; + margin-right: 0; + max-width: initial; + min-width: initial; + position: relative; +} +#drupal-off-canvas td .dropbutton-widget .dropbutton { + margin: 0; + width: 2em; + height: 2em; + overflow: hidden; + background: transparent; +} + +/* Push text out of the way. */ +#drupal-off-canvas td .dropbutton-multiple li, +#drupal-off-canvas td .dropbutton-multiple a { + margin-left: -9999px; + background: transparent; +} +#drupal-off-canvas td .dropbutton-multiple.open .dropbutton li, +#drupal-off-canvas td .dropbutton-multiple.open .dropbutton a { + margin-left: 0; + width: auto; + color: #fff; +} + +/* Collapse the button to a circle. */ +#drupal-off-canvas td .dropbutton-toggle { + width: 2em; + height: 2em; + border-radius: 1em; +} +#drupal-off-canvas td .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button { + border: 0; + background: transparent; +} + +/* Prevent list item from expanding it's container. */ +#drupal-off-canvas td ul.dropbutton li.edit { + width: 2em; + height: 2em; +} + +/* Make li text transparent above icon so it's clickable. */ +#drupal-off-canvas td .dropbutton-single li.edit.dropbutton-action > a { + color: transparent; + z-index: 1; +} + +/* Put pencil icon in place of hidden 'edit' text on single buttons. */ +#drupal-off-canvas td .dropbutton-single .edit:before { + content: '.'; + display: block; + color: transparent; + background: transparent url(../../../images/core/icons/ffffff/pencil.svg) no-repeat center; + background-size: 14px; +} + +/* Dropbutton when triggered expands to show secondary items. */ +#drupal-off-canvas .dropbutton-multiple.open { + z-index: 100; +} + +/* Create visual separation if there is an adjacent button. */ +#drupal-off-canvas .dropbutton-multiple.open .dropbutton-widget { + box-shadow: 0 3px 3px 2px rgba(0,0,0,0.5); +} + +/* Triggered dropbutton expands to show secondary items. */ +#drupal-off-canvas .dropbutton-multiple.open, +#drupal-off-canvas .dropbutton-multiple.open .dropbutton-widget { + display: block; + width: auto; + height: auto; + max-width: none; + min-width: 0; + padding: 0; + overflow: visible; +} + +/* Triggered dropbutton in td expands to show secondary items. */ +#drupal-off-canvas td .dropbutton-multiple.open .dropbutton, +#drupal-off-canvas .dropbutton-multiple.open .dropbutton .secondary-action { + display: block; + width: auto; + height: auto; + padding-right: 1em; /* LTR */ +} +[dir="rtl"] #drupal-off-canvas td .dropbutton-multiple.open .dropbutton { + padding-left: 1em; + padding-right: inherit; +} +#drupal-off-canvas .dropbutton-multiple.open .dropbutton li a { + padding: 2px 1em; +} + +/* When open, the toggle arrow points upward. */ +#drupal-off-canvas .dropbutton-multiple.open span.dropbutton-arrow { + border-bottom: 0.3333em solid; + border-top-color: transparent; + top: 2px; +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.form.css b/core/themes/stable/css/core/dialog/off-canvas.form.css new file mode 100644 index 0000000000000000000000000000000000000000..b47dbcc6f2b56d9f8b5dba9fc1bad80fd2a31f54 --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.form.css @@ -0,0 +1,136 @@ +/** + * @file + * Visual styling for forms in the off-canvas dialog. + */ + +#drupal-off-canvas form { + font-family: "Lucida Grande", 'Lucida Sans Unicode', 'liberation sans', sans-serif; + color: #ddd; +} +#drupal-off-canvas input[type="checkbox"] { + -webkit-appearance: checkbox; +} +#drupal-off-canvas input[type="radio"] { + -webkit-appearance: radio; +} +#drupal-off-canvas select { + -webkit-appearance: menulist; + -moz-appearance: menulist; +} +#drupal-off-canvas option { + display: block; + font-family: "Lucida Grande", 'Lucida Sans Unicode', 'liberation sans', sans-serif; +} +#drupal-off-canvas label { + line-height: normal; + font-family: inherit; + font-size: 12px; + font-weight: bold; + color: #ddd; +} +#drupal-off-canvas .visually-hidden { + opacity: 0; + height: 0; + width: 0; + letter-spacing: -2em; +} +#drupal-off-canvas .description, +#drupal-off-canvas .form-item .description, +#drupal-off-canvas .details-description { + color: #ddd; + margin-top: 5px; + font-family: inherit; + font-size: 12px; + font-style: normal; +} +#drupal-off-canvas .details-wrapper .description { + color: #bbb; +} +#drupal-off-canvas .form-item { + margin-bottom: 10px; + margin-top: 10px; +} +/* Set size and position for all inputs. */ +#drupal-off-canvas .form-select, +#drupal-off-canvas .form-text, +#drupal-off-canvas .form-tel, +#drupal-off-canvas .form-email, +#drupal-off-canvas .form-url, +#drupal-off-canvas .form-search, +#drupal-off-canvas .form-number, +#drupal-off-canvas .form-color, +#drupal-off-canvas .form-file, +#drupal-off-canvas .form-textarea, +#drupal-off-canvas .form-date, +#drupal-off-canvas .form-time { + box-sizing: border-box; + max-width: 100%; + padding: 6px; + margin: 5px 0 0 0; + border-width: 1px; + border-radius: 2px; + display: block; + font-family: inherit; + font-size: 14px; + color: #333; + line-height: 16px; +} +/* Reduce contrast for fields against dark background. */ +#drupal-off-canvas .form-text, +#drupal-off-canvas .form-tel, +#drupal-off-canvas .form-email, +#drupal-off-canvas .form-url, +#drupal-off-canvas .form-search, +#drupal-off-canvas .form-number, +#drupal-off-canvas .form-color, +#drupal-off-canvas .form-file, +#drupal-off-canvas .form-textarea, +#drupal-off-canvas .form-date, +#drupal-off-canvas .form-time { + box-shadow: inset 0 1px 2px rgba(0, 0, 0, .125); + background-color: #eee; + border-color: #333; + color: #595959; +} +#drupal-off-canvas .form-text:focus, +#drupal-off-canvas .form-tel:focus, +#drupal-off-canvas .form-email:focus, +#drupal-off-canvas .form-url:focus, +#drupal-off-canvas .form-search:focus, +#drupal-off-canvas .form-number:focus, +#drupal-off-canvas .form-color:focus, +#drupal-off-canvas .form-file:focus, +#drupal-off-canvas .form-textarea:focus, +#drupal-off-canvas .form-date:focus, +#drupal-off-canvas .form-time:focus { + border-color: #40b6ff; + box-shadow: inset 0 1px 3px rgba(0, 0, 0, .125), 0 0 8px #40b6ff; + background-color: #fff; +} +#drupal-off-canvas td .form-item, +#drupal-off-canvas td .form-select { + margin: 0; +} +#drupal-off-canvas .form-file { + margin-bottom: 5px; + width: 100%; +} +#drupal-off-canvas .form-actions { + text-align: center; + margin: 10px 0; +} +#drupal-off-canvas .ui-autocomplete { + background-color: white; + position: absolute; + top: 0; + left: 0; + cursor: default; +} +#drupal-off-canvas .ui-autocomplete li { + display: block; +} +#drupal-off-canvas .ui-autocomplete li a { + color: #595959 !important; + cursor: pointer; + padding: 5px; +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.motion.css b/core/themes/stable/css/core/dialog/off-canvas.motion.css new file mode 100644 index 0000000000000000000000000000000000000000..2d5ea5f6ed142ef71ee919e045d5fe6e9fc50ccd --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.motion.css @@ -0,0 +1,11 @@ +/** + * @file + * Motion effects for off-canvas dialog. + * + * Motion effects are in a separate file so that they can be easily turned off + * to improve performance if desired. + */ + +.dialog-off-canvas-main-canvas { + transition: all .7s ease; +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.reset.css b/core/themes/stable/css/core/dialog/off-canvas.reset.css new file mode 100644 index 0000000000000000000000000000000000000000..ee12792ff1ba6c6e75377961baa928b74ef4b275 --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.reset.css @@ -0,0 +1,388 @@ +/** + * @file + * Reset most HTML elements styles for the off-canvas dialog. + * + * This is a generic reset. Drupal-specific classes are reset in components. + */ + +/** + * Do not include div in then initial overrides because including div will + * cause the need for many more overrides in this file. + */ +#drupal-off-canvas *:not(div), +#drupal-off-canvas *:not(svg *), +#drupal-off-canvas *:after, +#drupal-off-canvas *:before { + all: initial; + box-sizing: border-box; + text-shadow: none; + -webkit-font-smoothing: antialiased; + -webkit-tap-highlight-color: initial; +} + +/* Reset size and position on elements. */ +#drupal-off-canvas a, +#drupal-off-canvas abbr, +#drupal-off-canvas acronym, +#drupal-off-canvas address, +#drupal-off-canvas applet, +#drupal-off-canvas article, +#drupal-off-canvas aside, +#drupal-off-canvas audio, +#drupal-off-canvas b, +#drupal-off-canvas big, +#drupal-off-canvas blockquote, +#drupal-off-canvas body, +#drupal-off-canvas canvas, +#drupal-off-canvas caption, +#drupal-off-canvas cite, +#drupal-off-canvas code, +#drupal-off-canvas dd, +#drupal-off-canvas del, +#drupal-off-canvas dfn, +#drupal-off-canvas dialog, +#drupal-off-canvas dl, +#drupal-off-canvas dt, +#drupal-off-canvas em, +#drupal-off-canvas embed, +#drupal-off-canvas fieldset, +#drupal-off-canvas figcaption, +#drupal-off-canvas figure, +#drupal-off-canvas footer, +#drupal-off-canvas form, +#drupal-off-canvas h1, +#drupal-off-canvas h2, +#drupal-off-canvas h3, +#drupal-off-canvas h4, +#drupal-off-canvas h5, +#drupal-off-canvas h6, +#drupal-off-canvas header, +#drupal-off-canvas hgroup, +#drupal-off-canvas hr, +#drupal-off-canvas html, +#drupal-off-canvas i, +#drupal-off-canvas iframe, +#drupal-off-canvas img, +#drupal-off-canvas ins, +#drupal-off-canvas kbd, +#drupal-off-canvas label, +#drupal-off-canvas legend, +#drupal-off-canvas li, +#drupal-off-canvas main, +#drupal-off-canvas mark, +#drupal-off-canvas menu, +#drupal-off-canvas meter, +#drupal-off-canvas nav, +#drupal-off-canvas object, +#drupal-off-canvas ol, +#drupal-off-canvas output, +#drupal-off-canvas p, +#drupal-off-canvas pre, +#drupal-off-canvas progress, +#drupal-off-canvas q, +#drupal-off-canvas rp, +#drupal-off-canvas rt, +#drupal-off-canvas s, +#drupal-off-canvas samp, +#drupal-off-canvas section, +#drupal-off-canvas small, +#drupal-off-canvas span, +#drupal-off-canvas strike, +#drupal-off-canvas strong, +#drupal-off-canvas sub, +#drupal-off-canvas sup, +#drupal-off-canvas table, +#drupal-off-canvas tbody, +#drupal-off-canvas td, +#drupal-off-canvas tfoot, +#drupal-off-canvas th, +#drupal-off-canvas thead, +#drupal-off-canvas time, +#drupal-off-canvas tr, +#drupal-off-canvas tt, +#drupal-off-canvas u, +#drupal-off-canvas ul, +#drupal-off-canvas var, +#drupal-off-canvas video, +#drupal-off-canvas xmp { + border: 0; + margin: 0; + padding: 0; + font-size: 100%; +} + +/* + * Override the default (display: inline) for browsers that do not recognize HTML5 tags. + * IE8 (and lower) requires a shiv: http://ejohn.org/blog/html5-shiv + */ +#drupal-off-canvas article, +#drupal-off-canvas aside, +#drupal-off-canvas figcaption, +#drupal-off-canvas figure, +#drupal-off-canvas footer, +#drupal-off-canvas header, +#drupal-off-canvas hgroup, +#drupal-off-canvas main, +#drupal-off-canvas menu, +#drupal-off-canvas nav, +#drupal-off-canvas section { + display: block; + line-height: normal; + border-radius: 0; +} + +/* + * Makes browsers agree. + * IE + Opera = font-weight: bold. + * Gecko + WebKit = font-weight: bolder. + */ +#drupal-off-canvas b, +#drupal-off-canvas strong { + font-weight: bold; +} + +#drupal-off-canvas em, +#drupal-off-canvas i { + font-style: italic; +} + +#drupal-off-canvas img { + color: transparent; + font-size: 0; + vertical-align: middle; +} + +#drupal-off-canvas ul, +#drupal-off-canvas ol { + list-style: none; +} + +/* reset table styling. */ +#drupal-off-canvas table { + border-collapse: collapse; + border-spacing: 0; +} +#drupal-off-canvas table thead, +#drupal-off-canvas table tbody, +#drupal-off-canvas table tbody tr:nth-child(even), +#drupal-off-canvas table tbody tr:nth-child(odd), +#drupal-off-canvas table tfoot { + border: 0; + background: transparent none; +} +#drupal-off-canvas th, +#drupal-off-canvas td, +#drupal-off-canvas caption { + font-weight: normal; +} +#drupal-off-canvas q { + quotes: none; +} +#drupal-off-canvas q:before, +#drupal-off-canvas q:after { + content: none; +} +#drupal-off-canvas sub, +#drupal-off-canvas sup, +#drupal-off-canvas small { + font-size: 75%; +} +#drupal-off-canvas sub, +#drupal-off-canvas sup { + line-height: 0; + position: relative; + vertical-align: baseline; +} +#drupal-off-canvas sub { + bottom: -0.25em; +} +#drupal-off-canvas sup { + top: -0.5em; +} + +/* + * For IE9. Without, occasionally draws shapes + * outside the boundaries of <svg> rectangle. + */ +#drupal-off-canvas svg { + overflow: hidden; +} + +/* Specific resets for inputs. */ +#drupal-off-canvas input[type="search"]::-webkit-search-decoration { + display: none; +} +#drupal-off-canvas input { + margin: 0; + padding: 0; +} +#drupal-off-canvas input[type="checkbox"], +#drupal-off-canvas input[type="radio"] { + position: static; + margin: 0; +} +#drupal-off-canvas input:invalid, +#drupal-off-canvas button:invalid, +#drupal-off-canvas select:invalid, +#drupal-off-canvas textarea:invalid, +#drupal-off-canvas input:focus, +#drupal-off-canvas button:focus, +#drupal-off-canvas select:focus, +#drupal-off-canvas textarea:focus, +#drupal-off-canvas input[type="file"]:focus, +#drupal-off-canvas input[type="file"]:active, +#drupal-off-canvas input[type="radio"]:focus, +#drupal-off-canvas input[type="radio"]:active, +#drupal-off-canvas input[type="checkbox"]:focus, +#drupal-off-canvas input[type="checkbox"]:active { + box-shadow: none; + z-index: 1; +} +#drupal-off-canvas input[role="button"] { + cursor: pointer; +} +#drupal-off-canvas button, +#drupal-off-canvas input[type="reset"], +#drupal-off-canvas input[type="submit"], +#drupal-off-canvas input[type="button"] { + -webkit-appearance: none; + -moz-appearance: none; + display: inline-block; + background-image: none; + border: 0; + outline: 0; + overflow: visible; + text-shadow: none; + text-decoration: none; + vertical-align: middle; + cursor: pointer; +} +#drupal-off-canvas button:hover, +#drupal-off-canvas input[type="reset"]:hover, +#drupal-off-canvas input[type="submit"]:hover, +#drupal-off-canvas input[type="button"]:hover { + background-image: none; + text-decoration: none; +} +#drupal-off-canvas button:active, +#drupal-off-canvas input[type="reset"]:active, +#drupal-off-canvas input[type="submit"]:active, +#drupal-off-canvas input[type="button"]:active { + background-image: none; + box-shadow: none; + border-color: grey; +} +#drupal-off-canvas button::-moz-focus-inner, +#drupal-off-canvas input[type="reset"]::-moz-focus-inner, +#drupal-off-canvas input[type="submit"]::-moz-focus-inner, +#drupal-off-canvas input[type="button"]::-moz-focus-inner { + border: 0; + padding: 0; +} +#drupal-off-canvas textarea, +#drupal-off-canvas select, +#drupal-off-canvas input[type="date"], +#drupal-off-canvas input[type="datetime"], +#drupal-off-canvas input[type="datetime-local"], +#drupal-off-canvas input[type="email"], +#drupal-off-canvas input[type="month"], +#drupal-off-canvas input[type="number"], +#drupal-off-canvas input[type="password"], +#drupal-off-canvas input[type="search"], +#drupal-off-canvas input[type="tel"], +#drupal-off-canvas input[type="text"], +#drupal-off-canvas input[type="time"], +#drupal-off-canvas input[type="url"], +#drupal-off-canvas input[type="week"] { + height: auto; + vertical-align: middle; + border-radius: 0; +} +#drupal-off-canvas textarea[disabled], +#drupal-off-canvas select[disabled], +#drupal-off-canvas input[type="date"][disabled], +#drupal-off-canvas input[type="datetime"][disabled], +#drupal-off-canvas input[type="datetime-local"][disabled], +#drupal-off-canvas input[type="email"][disabled], +#drupal-off-canvas input[type="month"][disabled], +#drupal-off-canvas input[type="number"][disabled], +#drupal-off-canvas input[type="password"][disabled], +#drupal-off-canvas input[type="search"][disabled], +#drupal-off-canvas input[type="tel"][disabled], +#drupal-off-canvas input[type="text"][disabled], +#drupal-off-canvas input[type="time"][disabled], +#drupal-off-canvas input[type="url"][disabled], +#drupal-off-canvas input[type="week"][disabled] { + background-color: grey; +} +#drupal-off-canvas input[type="hidden"] { + visibility: hidden; +} +#drupal-off-canvas button[disabled], +#drupal-off-canvas input[disabled], +#drupal-off-canvas select[disabled], +#drupal-off-canvas select[disabled] option, +#drupal-off-canvas select[disabled] optgroup, +#drupal-off-canvas textarea[disabled] { + box-shadow: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: default; +} +#drupal-off-canvas input:placeholder, +#drupal-off-canvas textarea:placeholder { + color: grey; +} +#drupal-off-canvas textarea, +#drupal-off-canvas select[size], +#drupal-off-canvas select[multiple] { + height: auto; +} +#drupal-off-canvas select[size="0"], +#drupal-off-canvas select[size="1"] { + height: auto; +} +#drupal-off-canvas textarea { + min-height: 40px; + overflow: auto; + resize: vertical; + width: 100%; +} +#drupal-off-canvas optgroup { + color: black; + font-style: normal; + font-weight: normal; +} +#drupal-off-canvas optgroup::-moz-focus-inner { + border: 0; + padding: 0; +} +#drupal-off-canvas * button { + background: none; + border: 1px solid grey; + color: black; + padding: 0; + text-decoration: none; + overflow: visible; + vertical-align: middle; + width: auto; +} +#drupal-off-canvas * textarea, +#drupal-off-canvas * select, +#drupal-off-canvas *:not(div) textarea, +#drupal-off-canvas *:not(div) select { + background: white; + border: 1px solid grey; + color: black; + padding: 0; + vertical-align: top; +} + +/* To standardize off-canvas selection color. */ +#drupal-off-canvas ::-moz-selection, +#drupal-off-canvas ::selection { + background-color: rgba(175,175,175,0.5); + color: inherit; +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.table.css b/core/themes/stable/css/core/dialog/off-canvas.table.css new file mode 100644 index 0000000000000000000000000000000000000000..03efbd6326deed5a5c37e60b1ef11e0d79aac536 --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.table.css @@ -0,0 +1,90 @@ +/** + * @file + * Visual styling for tables in the off-canvas dialog. + */ + +#drupal-off-canvas table * { + font-family: "Lucida Grande", 'Lucida Sans Unicode', 'liberation sans', sans-serif; +} +#drupal-off-canvas table { + display: table; + width: 100%; + min-width: calc(100% + 40px); + /* Cancel out the padding of the parent to make the table full width. */ + margin: 0 -20px -10px -20px; + border: 0; + border-collapse: collapse; + font-size: 12px; + color: #ddd; +} +#drupal-off-canvas table thead { + display: table-header-group; +} +#drupal-off-canvas table tbody { + display: table-row-group; +} +#drupal-off-canvas tr { + display: table-row; +} +#drupal-off-canvas tr:hover td { + background-color: transparent; +} + +#drupal-off-canvas td, +#drupal-off-canvas th { + display: table-cell; + height: auto; + width: auto; + padding: 2px 8px; + vertical-align: middle; + border-bottom: 1px solid #777; + background-color: transparent; +} +[dir="rtl"] #drupal-off-canvas th, +[dir="rtl"] #drupal-off-canvas td { + text-align: right; +} +#drupal-off-canvas th { + font-weight: bold; + color: #bbb; +} +#drupal-off-canvas th.checkbox, +#drupal-off-canvas td.checkbox { + width: 20px; + padding: 0; + text-align: center; +} +#drupal-off-canvas div.checkbox.menu-enabled { + position: static; + display: inline; + width: auto; +} +#drupal-off-canvas th:first-child, +#drupal-off-canvas td:first-child { + width: 150px; +} +/* For lack of a better class, using this to grab the operations th. */ +#drupal-off-canvas .tabledrag-has-colspan { + text-align: right; + padding-right: 20px; +} +#drupal-off-canvas td { + padding: 6px 8px; + color: #ddd; +} +/* Hide overflow with ellipsis for links. */ +#drupal-off-canvas td a { + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + background: transparent; +} +#drupal-off-canvas tr td:first-child, +#drupal-off-canvas tr th:first-child { + padding-left: 20px; /* LTR */ +} +[dir="rtl"] #drupal-off-canvas tr td:first-child, +[dir="rtl"] #drupal-off-canvas tr th:first-child { + padding-right: 20px; +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.tabledrag.css b/core/themes/stable/css/core/dialog/off-canvas.tabledrag.css new file mode 100644 index 0000000000000000000000000000000000000000..33f670aad5745fe487cbfbb8bc9484822398d16a --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.tabledrag.css @@ -0,0 +1,122 @@ +/** + * @file + * Table drag behavior for off-canvas dialog. + * + * @see tabledrag.js + */ + +#drupal-off-canvas .drag { + cursor: move; +} +#drupal-off-canvas tr.region-title { + font-weight: normal; +} +#drupal-off-canvas table .region-message { + color: #fff; +} +#drupal-off-canvas table .region-populated { + display: none; +} +#drupal-off-canvas .add-new .tabledrag-changed { + display: none; +} +#drupal-off-canvas .draggable a.tabledrag-handle { + background-image: none; + margin: 0 5px 0 0; + height: auto; + min-width: 20px; + padding: 0; + overflow: hidden; + float: left; /* LTR */ + text-decoration: none; + cursor: move; +} +[dir="rtl"] #drupal-off-canvas .draggable a.tabledrag-handle { + float: right; + margin-right: 0; + margin-left: 5px; +} +#drupal-off-canvas a.tabledrag-handle .handle { + /* Use lighter drag icon against dark background. */ + background-image: url(../../../images/core/icons/bebebe/move.svg); + background-color: transparent; + background-repeat: no-repeat; + background-position: center; + height: auto; + margin: 0; + padding: 0; + width: auto; +} +#drupal-off-canvas .draggable a.tabledrag-handle:hover .handle, +#drupal-off-canvas .draggable a.tabledrag-handle:focus .handle { + background-image: url(../../../images/core/icons/787878/move.svg); + text-decoration: none; +} +#drupal-off-canvas tr td { + transition: background .3s ease; +} + +#drupal-off-canvas tr td abbr { + margin-left: 5px; /* LTR */ +} + +[dir="rtl"] #drupal-off-canvas tr td abbr { + margin-left: 0; + margin-right: 5px; +} +#drupal-off-canvas tr:hover td { + background: #222; +} +#drupal-off-canvas tr.drag td { + background: #111; +} +#drupal-off-canvas tr.drag-previous td { + background: #000; +} +#drupal-off-canvas tr.drag-previous:hover td { + background: #222; +} +body div.tabledrag-changed-warning { + margin-bottom: 0.5em; + font-size: 14px; +} +#drupal-off-canvas .touchevents .draggable td { + padding: 0 10px; +} +#drupal-off-canvas .touchevents .draggable .menu-item__link { + display: inline-block; + padding: 10px 0; +} +#drupal-off-canvas .touchevents a.tabledrag-handle { + height: 44px; + width: 40px; +} +#drupal-off-canvas .touchevents a.tabledrag-handle .handle { + background-position: 40% 19px; /* LTR */ + height: 21px; +} +[dir="rtl"] #drupal-off-canvas .touch a.tabledrag-handle .handle { + background-position: right 40% top 19px; +} +#drupal-off-canvas .touchevents .draggable.drag a.tabledrag-handle .handle { + background-position: 50% -32px; +} +#drupal-off-canvas .tabledrag-toggle-weight-wrapper { + padding-top: 10px; + text-align: right; /* LTR */ +} +[dir="rtl"] #drupal-off-canvas .tabledrag-toggle-weight-wrapper { + text-align: left; +} +#drupal-off-canvas .indentation { + float: left; /* LTR */ + height: auto; + margin: 0 3px 0 -10px; /* LTR */ + padding: 0 0 0 10px; /* LTR */ + width: auto; +} +[dir="rtl"] #drupal-off-canvas .indentation { + float: right; + margin: 0 -10px 0 3px; + padding: 0 10px 0 0; +} diff --git a/core/themes/stable/css/core/dialog/off-canvas.theme.css b/core/themes/stable/css/core/dialog/off-canvas.theme.css new file mode 100644 index 0000000000000000000000000000000000000000..89eb682db44a1b47855aa7d9bc436631595925c8 --- /dev/null +++ b/core/themes/stable/css/core/dialog/off-canvas.theme.css @@ -0,0 +1,93 @@ +/** + * @file + * Styling for the off-canvas ui dialog. Including overrides for jQuery UI. + */ + +/* Style the dialog-off-canvas container. */ +.ui-dialog.ui-dialog-off-canvas { + background: #444; + border: 0 solid transparent; + border-radius: 0; + box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.3333); + padding: 0; + color: #ddd; + /* Layer the dialog just under the toolbar. */ + z-index: 501; +} + +/* Style the off-canvas dialog header. */ +.ui-dialog.ui-dialog-off-canvas .ui-dialog-titlebar { + padding: 1em; + background: #2d2d2d; + border: 0; + border-bottom: 1px solid #000; + border-radius: 0; + font-weight: normal; + color: #fff; +} +/* Hide the default jQuery UI dialog close button. */ +.ui-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close .ui-icon { + visibility: hidden; +} +.ui-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close { + background-image: url(../../../images/core/icons/bebebe/ex.svg); + background-position: center center; + background-repeat: no-repeat; + background-color: transparent; + border: 0; + position: absolute; + right: 1em; + transition: background .5s ease; +} +.ui-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close:hover { + background-image: url(../../../images/core/icons/ffffff/ex.svg); +} +[dir="rtl"] .ui-dialog.ui-dialog-off-canvas .ui-dialog-titlebar-close { + left: 1em; + right: auto; +} +.ui-dialog.ui-dialog-off-canvas .ui-dialog-title { + margin: 0; + /* Push the text away from the icon. */ + padding-left: 30px; /* LTR */ + padding-right: 0; /* LTR */ + /* Ensure that long titles do not overlap the close button. */ + max-width: 210px; + font-size: 16px; + font-family: "Lucida Grande", 'Lucida Sans Unicode', 'liberation sans', sans-serif; + text-align: left; /* LTR */ +} +[dir="rtl"] .ui-dialog.ui-dialog-off-canvas .ui-dialog-title { + float: right; + text-align: right; + padding-left: 0; + padding-right: 30px; +} +.ui-dialog.ui-dialog-off-canvas .ui-dialog-title:before { + background: transparent url(../../../images/core/icons/ffffff/pencil.svg) no-repeat scroll center center; + background-size: 100% auto; + content: ''; + display: block; + height: 100%; + position: absolute; + left: 1em; /* LTR */ + top: 0; + width: 20px; +} +[dir="rtl"] .ui-dialog.ui-dialog-off-canvas .ui-dialog-title:before { + left: auto; + right: 1em; +} + +/* Override default styling from jQuery UI. */ +#drupal-off-canvas .ui-state-default, +#drupal-off-canvas .ui-widget-content .ui-state-default, +#drupal-off-canvas .ui-widget-header .ui-state-default { + border: 0; + font-weight: normal; + font-size: 14px; + color: #333; +} +#drupal-off-canvas .ui-widget-content a { + color: #85bef4; +} diff --git a/core/themes/stable/stable.info.yml b/core/themes/stable/stable.info.yml index 251ecbd534dbdeeb181cd2090d6c4a96b7a02da7..1e437f9d4c1b2b52cd84d23db43802aec1bf9b48 100644 --- a/core/themes/stable/stable.info.yml +++ b/core/themes/stable/stable.info.yml @@ -57,6 +57,22 @@ libraries-override: component: css/contextual.toolbar.css: css/contextual/contextual.toolbar.css + core/drupal.dialog.off_canvas: + css: + base: + misc/dialog/off-canvas.reset.css: css/core/dialog/off-canvas.reset.css + misc/dialog/off-canvas.base.css: css/core/dialog/off-canvas.base.css + misc/dialog/off-canvas.css: css/core/dialog/off-canvas.css + misc/dialog/off-canvas.theme.css: css/core/dialog/off-canvas.theme.css + component: + misc/dialog/off-canvas.motion.css: css/core/dialog/off-canvas.motion.css + misc/dialog/off-canvas.button.css: css/core/dialog/off-canvas.button.css + misc/dialog/off-canvas.form.css: css/core/dialog/off-canvas.form.css + misc/dialog/off-canvas.table.css: css/core/dialog/off-canvas.table.css + misc/dialog/off-canvas.details.css: css/core/dialog/off-canvas.details.css + misc/dialog/off-canvas.tabledrag.css: css/core/dialog/off-canvas.tabledrag.css + misc/dialog/off-canvas.dropbutton.css: css/core/dialog/off-canvas.dropbutton.css + core/drupal.dropbutton: css: component: diff --git a/core/themes/stable/templates/content/off-canvas-page-wrapper.html.twig b/core/themes/stable/templates/content/off-canvas-page-wrapper.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..2c8e23c6258a35b70e4b5c2fb6f1a06d8253b9a0 --- /dev/null +++ b/core/themes/stable/templates/content/off-canvas-page-wrapper.html.twig @@ -0,0 +1,24 @@ +{# +/** + * @file + * Theme override for page wrapper. + * + * For consistent wrapping to {{ page }} render in all themes. The + * "data-off-canvas-main-canvas" attribute is required by the off-canvas dialog. + * This is used by the core/drupal.dialog.off_canvas library to select the + * "main canvas" page element as opposed to the "off canvas" which is the dialog + * itself. The "main canvas" element must be resized according to the width of + * the "off canvas" dialog so that no portion of the "main canvas" is obstructed + * by the off-canvas dialog. The off-canvas dialog can vary in width when opened + * and can be resized by the user. The "data-off-canvas-main-canvas" attribute + * cannot be removed without breaking the off-canvas dialog functionality. + * + * Available variables: + * - children: Contains the child elements of the page. + */ +#} +{% if children %} + <div class="dialog-off-canvas-main-canvas" data-off-canvas-main-canvas> + {{ children }} + </div> +{% endif %}