@wordpress/interface
Version:
Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.
442 lines (422 loc) • 9.94 kB
CSS
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Colors
*/
/**
* Breakpoints & Media Queries
*/
/**
* SCSS Variables.
*
* Please use variables from this sheet to ensure consistency across the UI.
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Colors
*/
/**
* Fonts & basic variables.
*/
/**
* Typography
*/
/**
* Grid System.
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
*/
/**
* Radius scale.
*/
/**
* Elevation scale.
*/
/**
* Dimensions.
*/
/**
* Mobile specific styles
*/
/**
* Editor styles.
*/
/**
* Block & Editor UI.
*/
/**
* Block paddings.
*/
/**
* React Native specific.
* These variables do not appear to be used anywhere else.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Long content fade mixin
*
* Creates a fading overlay to signify that the content is longer
* than the space allows.
*/
/**
* Typography
*/
/**
* Breakpoint mixins
*/
/**
* Focus styles.
*/
/**
* Applies editor left position to the selector passed as argument
*/
/**
* Styles that are reused verbatim in a few places
*/
/**
* Allows users to opt-out of animations via OS-level preferences.
*/
/**
* Reset default styles for JavaScript UI based pages.
* This is a WP-admin agnostic reset
*/
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
:root {
--wp-admin-theme-color: #007cba;
--wp-admin-theme-color--rgb: 0, 124, 186;
--wp-admin-theme-color-darker-10: #006ba1;
--wp-admin-theme-color-darker-10--rgb: 0, 107, 161;
--wp-admin-theme-color-darker-20: #005a87;
--wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
--wp-admin-border-width-focus: 2px;
--wp-block-synced-color: #7a00df;
--wp-block-synced-color--rgb: 122, 0, 223;
--wp-bound-block-color: var(--wp-block-synced-color);
}
@media (min-resolution: 192dpi) {
:root {
--wp-admin-border-width-focus: 1.5px;
}
}
.interface-complementary-area-header {
background: #fff;
padding-right: 8px;
gap: 4px;
}
.interface-complementary-area-header .interface-complementary-area-header__title {
margin: 0 auto 0 0;
}
.interface-complementary-area {
background: #fff;
color: #1e1e1e;
height: 100%;
overflow: auto;
}
@media (min-width: 600px) {
.interface-complementary-area {
-webkit-overflow-scrolling: touch;
}
}
@media (min-width: 782px) {
.interface-complementary-area {
width: 280px;
}
}
.interface-complementary-area .components-panel {
border: none;
position: relative;
z-index: 0;
}
.interface-complementary-area .components-panel__header {
position: sticky;
top: 0;
z-index: 1;
}
.interface-complementary-area .components-panel__header.editor-sidebar__panel-tabs {
top: 0;
}
.interface-complementary-area p:not(.components-base-control__help, .components-form-token-field__help) {
margin-top: 0;
}
.interface-complementary-area h2 {
font-size: 13px;
font-weight: 500;
color: #1e1e1e;
margin-bottom: 1.5em;
}
.interface-complementary-area h3 {
font-size: 11px;
text-transform: uppercase;
font-weight: 500;
color: #1e1e1e;
margin-bottom: 1.5em;
}
.interface-complementary-area hr {
border-top: none;
border-bottom: 1px solid #f0f0f0;
margin: 1.5em 0;
}
.interface-complementary-area div.components-toolbar-group,
.interface-complementary-area div.components-toolbar {
box-shadow: none;
margin-bottom: 1.5em;
}
.interface-complementary-area div.components-toolbar-group:last-child,
.interface-complementary-area div.components-toolbar:last-child {
margin-bottom: 0;
}
.interface-complementary-area .block-editor-skip-to-selected-block:focus {
top: auto;
right: 10px;
bottom: 10px;
left: auto;
}
.interface-complementary-area__fill {
height: 100%;
}
@media (min-width: 782px) {
body.js.is-fullscreen-mode {
margin-top: -32px;
height: calc(100% + 32px);
}
body.js.is-fullscreen-mode #adminmenumain,
body.js.is-fullscreen-mode #wpadminbar {
display: none;
}
body.js.is-fullscreen-mode #wpcontent,
body.js.is-fullscreen-mode #wpfooter {
margin-left: 0;
}
}
html.interface-interface-skeleton__html-container {
position: fixed;
width: 100%;
}
@media (min-width: 782px) {
html.interface-interface-skeleton__html-container:not(:has(.is-zoom-out)) {
position: initial;
width: initial;
}
}
.interface-interface-skeleton {
display: flex;
flex-direction: row;
height: auto;
max-height: 100%;
position: fixed;
top: 46px;
left: 0;
right: 0;
bottom: 0;
}
@media (min-width: 783px) {
.interface-interface-skeleton {
top: 32px;
}
.is-fullscreen-mode .interface-interface-skeleton {
top: 0;
}
}
.interface-interface-skeleton__editor {
display: flex;
flex-direction: column;
flex: 0 1 100%;
overflow: hidden;
}
.interface-interface-skeleton { /* Set left position when auto-fold is not on the body element. */
left: 0;
}
@media (min-width: 783px) {
.interface-interface-skeleton {
left: 160px;
}
}
.auto-fold .interface-interface-skeleton { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */ }
@media (min-width: 783px) {
.auto-fold .interface-interface-skeleton {
left: 36px;
}
}
@media (min-width: 961px) {
.auto-fold .interface-interface-skeleton {
left: 160px;
}
}
/* Sidebar manually collapsed. */
.folded .interface-interface-skeleton {
left: 0;
}
@media (min-width: 783px) {
.folded .interface-interface-skeleton {
left: 36px;
}
}
body.is-fullscreen-mode .interface-interface-skeleton {
left: 0 ;
}
.interface-interface-skeleton__body {
position: relative;
flex-grow: 1;
display: flex;
overflow: auto;
overscroll-behavior-y: none;
}
@media (min-width: 782px) {
.has-footer .interface-interface-skeleton__body {
padding-bottom: 25px;
}
}
.interface-interface-skeleton__content {
flex-grow: 1;
display: flex;
flex-direction: column;
overflow: auto;
z-index: 20;
}
@media (min-width: 782px) {
.interface-interface-skeleton__content {
z-index: auto;
}
}
.interface-interface-skeleton__secondary-sidebar,
.interface-interface-skeleton__sidebar {
flex-shrink: 0;
position: absolute;
z-index: 100000;
top: 0;
left: 0;
bottom: 0;
background: #fff;
color: #1e1e1e;
width: auto;
}
@media (min-width: 782px) {
.interface-interface-skeleton__secondary-sidebar,
.interface-interface-skeleton__sidebar {
position: relative ;
}
}
.interface-interface-skeleton__sidebar {
border-top: 1px solid #e0e0e0;
overflow: hidden;
}
@media (min-width: 782px) {
.interface-interface-skeleton__sidebar {
box-shadow: -1px 0 0 0 rgba(0, 0, 0, 0.133);
outline: 1px solid transparent;
}
}
.interface-interface-skeleton__secondary-sidebar {
border-top: 1px solid #e0e0e0;
right: 0;
}
@media (min-width: 782px) {
.interface-interface-skeleton__secondary-sidebar {
box-shadow: 1px 0 0 0 rgba(0, 0, 0, 0.133);
outline: 1px solid transparent;
}
}
.interface-interface-skeleton__header {
flex-shrink: 0;
height: auto;
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.133);
z-index: 30;
color: #1e1e1e;
outline: 1px solid transparent;
}
.interface-interface-skeleton__footer {
height: auto;
flex-shrink: 0;
border-top: 1px solid #e0e0e0;
color: #1e1e1e;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
background-color: #fff;
z-index: 90;
display: none;
}
@media (min-width: 782px) {
.interface-interface-skeleton__footer {
display: flex;
}
}
.interface-interface-skeleton__footer .block-editor-block-breadcrumb {
z-index: 30;
display: flex;
background: #fff;
height: 24px;
align-items: center;
font-size: 13px;
padding: 0 18px;
}
.interface-interface-skeleton__actions {
z-index: 100000;
position: fixed ;
top: -9999em;
bottom: auto;
left: auto;
right: 0;
color: #1e1e1e;
background: #fff;
width: 100vw;
}
@media (min-width: 782px) {
.interface-interface-skeleton__actions {
width: 280px;
}
}
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
top: auto;
bottom: 0;
}
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
top: 46px;
}
@media (min-width: 782px) {
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
border-left: 1px solid #ddd;
top: 32px;
}
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
top: 0;
}
}
.interface-pinned-items {
display: flex;
gap: 8px;
}
.interface-pinned-items .components-button {
display: none;
margin: 0;
}
.interface-pinned-items .components-button[aria-controls="edit-post:document"], .interface-pinned-items .components-button[aria-controls="edit-post:block"], .interface-pinned-items .components-button[aria-controls="edit-site:template"], .interface-pinned-items .components-button[aria-controls="edit-site:block-inspector"] {
display: flex;
}
.interface-pinned-items .components-button svg {
max-width: 24px;
max-height: 24px;
}
@media (min-width: 600px) {
.interface-pinned-items .components-button {
display: flex;
}
}