@wordpress/global-styles-ui
Version:
Global Styles UI components for WordPress.
727 lines (653 loc) • 17.2 kB
CSS
/**
* 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.
*/
/**
* 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.
*/
/**
* Typography
*/
/**
* Breakpoints & Media Queries
*/
/**
* 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.
*/
/**
* Breakpoint mixins
*/
/**
* Focus styles.
*/
/**
* Standard focus rings for the WordPress Design System.
*
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
* e.g. `&:focus { @include outset-ring__focus(); }`.
*/
/**
* 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.
*/
/**
* Creates a checkerboard pattern background to indicate transparency.
* @param {String} $size - The size of the squares in the checkerboard pattern. Default is 12px.
*/
@media (min-width: 782px) {
.font-library-modal.font-library-modal {
width: 65vw;
}
}
.font-library-modal .components-modal__header {
border-bottom: none;
}
.font-library-modal .components-modal__content {
padding: 0;
margin-bottom: 90px;
}
.font-library-modal .font-library__subtitle {
text-transform: uppercase;
font-weight: var(--wpds-typography-font-weight-emphasis, 600);
font-size: 11px;
}
.font-library-modal__tab-panel {
height: calc(100% - 50px);
}
.font-library__tabpanel-layout {
height: 100%;
display: flex;
flex-direction: column;
}
.font-library__tabpanel-layout > div {
flex-grow: 1;
}
.font-library__tabpanel-layout .font-library__loading {
width: 100%;
height: 100%;
display: flex;
position: absolute;
left: 0;
top: 0;
align-items: center;
justify-content: center;
padding-top: 124px;
box-sizing: border-box;
}
.font-library__tabpanel-layout .components-navigator-screen {
padding: 24px;
width: 100%;
}
.font-library__footer {
position: absolute;
width: 100%;
bottom: 0;
border-top: 1px solid var(--wpds-color-stroke-surface-neutral, #dbdbdb);
padding: 24px;
background-color: #fff;
box-sizing: border-box;
flex-grow: 0 ;
flex-shrink: 0;
height: 90px;
}
.font-library__page-selection {
font-size: 11px;
font-weight: var(--wpds-typography-font-weight-emphasis, 600);
text-transform: uppercase;
}
.font-library__page-selection-trigger {
font-size: inherit;
}
.font-library__page-selection-trigger button {
font-weight: inherit;
}
.font-library__search {
width: 240px;
}
.font-library__category {
width: 192px;
max-width: 50%;
flex-shrink: 0;
}
.font-library__fonts-title {
text-transform: uppercase;
font-size: 11px;
font-weight: var(--wpds-typography-font-weight-emphasis, 600);
margin-top: 0;
margin-bottom: 0;
}
.font-library__fonts-list {
list-style: none;
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
.font-library__fonts-list-item {
margin-bottom: 0;
}
.font-library__font-demo {
position: relative;
}
.font-library__font-card {
box-sizing: border-box;
border: 1px solid var(--wpds-color-stroke-surface-neutral, #dbdbdb);
width: 100%;
height: auto ;
padding: 16px;
margin-top: -1px; /* To collapse the margin with the previous element */
}
.font-library__font-card:hover {
background-color: #f0f0f0;
}
.font-library__font-card:focus {
position: relative;
}
.font-library__font-card .font-library__font-card__name {
font-weight: 700;
}
.font-library__font-card .font-library__font-card__count {
color: var(--wpds-color-foreground-content-neutral-weak, #6e6e6e);
}
.font-library__font-card .font-library__font-variant_demo-image {
display: block;
height: 24px;
width: auto;
}
@media not (prefers-reduced-motion) {
.font-library__font-card .font-library__font-variant_demo-image {
transition: opacity var(--wpds-motion-duration-lg, 300ms) var(--wpds-motion-easing-subtle, cubic-bezier(0.15, 0, 0.15, 1));
}
}
.font-library__font-card .font-library__font-variant_demo-image.is-loading {
position: absolute;
top: 0;
left: 0;
opacity: 0;
}
.font-library__font-card .font-library__font-variant-demo-skeleton {
height: 24px;
border-radius: var(--wpds-border-radius-sm, 2px);
}
.font-library__font-card .font-library__font-variant_demo-text {
white-space: nowrap;
flex-shrink: 0;
}
@media not (prefers-reduced-motion) {
.font-library__font-card .font-library__font-variant_demo-text {
transition: opacity 0.3s ease-in-out;
}
}
.font-library-modal__tablist-container {
position: sticky;
top: 0;
border-bottom: 1px solid var(--wpds-color-stroke-surface-neutral, #dbdbdb);
background: #fff;
z-index: 1;
}
.font-library__upload-area {
align-items: center;
display: flex;
justify-content: center;
height: 256px ;
width: 100%;
}
button.font-library__upload-area {
background-color: #f0f0f0;
}
.font-library__local-fonts {
margin: 24px auto;
width: 80%;
}
.font-library__local-fonts .font-library__upload-area__text {
color: var(--wpds-color-foreground-content-neutral-weak, #6e6e6e);
}
.font-library__google-fonts-confirm {
display: flex;
justify-content: center;
align-items: center;
margin-top: 64px;
}
.font-library__google-fonts-confirm p {
line-height: 1.4;
}
.font-library__google-fonts-confirm h2 {
font-size: 1.2rem;
font-weight: 400;
}
.font-library__google-fonts-confirm .components-card {
padding: 16px;
width: 400px;
}
.font-library__google-fonts-confirm .components-button {
width: 100%;
justify-content: center;
}
.font-library__select-all {
padding: 16px 16px 16px 17px;
}
.font-library__select-all .components-checkbox-control__label {
padding-left: 16px;
}
.global-styles-ui-screen-revisions {
display: flex;
flex-direction: column;
flex-grow: 1;
min-height: 0;
}
.global-styles-ui-screen-revisions__actions {
margin-inline-start: auto;
}
.global-styles-ui-screen-revisions__date {
text-transform: uppercase;
font-weight: var(--wpds-typography-font-weight-emphasis, 600);
font-size: 12px;
}
.global-styles-ui-screen-revisions__description {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
}
.global-styles-ui-screen-revisions__changes,
.global-styles-ui-screen-revisions__meta {
color: #2f2f2f;
font-size: 12px;
}
.global-styles-ui-screen-revisions__meta {
display: flex;
justify-content: start;
width: 100%;
align-items: center;
text-align: left;
}
.global-styles-ui-screen-revisions__meta img {
width: 16px;
height: 16px;
border-radius: 100%;
margin-right: 8px;
}
.global-styles-ui-screen-revisions__changes {
text-align: left;
line-height: 1.4;
margin: 0 0 0 12px;
list-style: disc;
}
.global-styles-ui-screen-revisions__changes li {
margin-bottom: 4px;
}
.global-styles-ui-variations_item {
box-sizing: border-box;
cursor: var(--wpds-cursor-control, pointer);
}
.global-styles-ui-variations_item .global-styles-ui-variations_item-preview {
border-radius: 2px;
outline: 1px solid rgba(0, 0, 0, 0.1);
outline-offset: -1px;
overflow: hidden;
position: relative;
}
@media not (prefers-reduced-motion) {
.global-styles-ui-variations_item .global-styles-ui-variations_item-preview {
transition: outline 0.1s linear;
}
}
.global-styles-ui-variations_item .global-styles-ui-variations_item-preview.is-pill {
height: 32px;
}
.global-styles-ui-variations_item .global-styles-ui-variations_item-preview.is-pill .block-editor-iframe__scale-container {
overflow: hidden;
}
.global-styles-ui-variations_item:not(.is-active):hover .global-styles-ui-variations_item-preview {
outline-color: rgba(0, 0, 0, 0.3);
}
.global-styles-ui-variations_item.is-active .global-styles-ui-variations_item-preview, .global-styles-ui-variations_item:focus-visible .global-styles-ui-variations_item-preview {
outline-color: #1e1e1e;
outline-offset: 1px;
outline-width: var(--wp-admin-border-width-focus);
}
.global-styles-ui-variations_item:focus-visible .global-styles-ui-variations_item-preview {
outline-color: var(--wp-admin-theme-color);
}
.global-styles-ui-preview__wrapper {
max-width: 100%;
display: block;
width: 100%;
}
.global-styles-ui-preview__wrapper.is-hoverable {
cursor: var(--wpds-cursor-control, pointer);
}
.global-styles-ui-typography-preview {
display: flex;
align-items: center;
justify-content: center;
min-height: 100px;
margin-bottom: 20px;
background: #f0f0f0;
border-radius: 2px;
overflow: hidden;
}
.global-styles-ui-element-preview {
flex-shrink: 0;
height: 120px;
margin: 0 16px 20px;
border-radius: 2px;
overflow: hidden;
background: #f0f0f0;
}
.global-styles-ui-element-preview iframe {
display: block;
width: 100%;
height: 100%;
border: 0;
}
.global-styles-ui-font-size__item {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
line-break: anywhere;
}
.global-styles-ui-font-size__item-value {
color: #757575;
}
.global-styles-ui-screen-typography__indicator {
height: 24px;
width: 24px;
font-size: 14px;
display: flex ;
align-items: center;
justify-content: center;
border-radius: 2px;
}
.global-styles-ui-block-types-filter {
margin-bottom: 16px;
padding: 0 16px;
}
.global-styles-ui-block-types-search {
flex-grow: 1;
}
.global-styles-ui-block-types-item-list {
margin-inline: 4px;
}
.global-styles-ui-block-types-item-list .global-styles-ui-block-types-item__icon {
min-width: 24px;
}
.global-styles-ui-block-types-item-list.global-styles-ui-element-block-overrides__list {
margin-inline: 0;
}
.global-styles-ui-block-types-item-list__no-results {
padding-top: 16px;
}
.global-styles-ui-block-types-group + .global-styles-ui-block-types-group {
margin-top: 12px;
}
.global-styles-ui-block-types-group:last-child {
padding-bottom: 12px;
}
.global-styles-ui-block-types-group__title {
margin-bottom: 12px;
padding: 0 16px;
}
.global-styles-ui-screen-typography__font-variants-count {
color: #757575;
}
.global-styles-ui-font-families__manage-fonts {
justify-content: center;
}
.global-styles-ui-screen .color-block-support-panel {
padding-left: 0;
padding-right: 0;
padding-top: 0;
border-top: none;
row-gap: 12px;
}
.global-styles-ui-header {
margin-bottom: 0 ;
line-height: 1.9 ;
}
.global-styles-ui-subtitle {
margin-bottom: 0 ;
text-transform: uppercase;
font-weight: var(--wpds-typography-font-weight-emphasis, 600) ;
font-size: 11px ;
}
.global-styles-ui-section-title {
color: #2f2f2f;
font-weight: var(--wpds-typography-font-weight-emphasis, 600);
line-height: 1.2;
padding: 16px 16px 0;
margin: 0;
}
.global-styles-ui-icon-with-current-color {
fill: currentColor;
}
.global-styles-ui__color-indicator-wrapper {
height: 24px;
flex-shrink: 0;
display: flex;
align-items: center;
}
.global-styles-ui__palette-preview {
display: inline-flex;
}
.global-styles-ui__palette-preview > * + * {
margin-inline-start: -8px;
}
.global-styles-ui__shadows-panel__options-container,
.global-styles-ui__typography-panel__options-container {
height: 24px;
}
.global-styles-ui__block-preview-panel {
position: relative;
width: 100%;
border: #ddd 1px solid;
border-radius: 2px;
overflow: hidden;
}
.global-styles-ui__shadow-preview-panel,
.global-styles-ui__text-shadow-preview-panel {
height: 144px;
border: #ddd 1px solid;
border-radius: 2px;
overflow: auto;
/*rtl:begin:ignore*/
background-image: repeating-linear-gradient(45deg, #e0e0e0 25%, transparent 25%, transparent 75%, #e0e0e0 75%, #e0e0e0), repeating-linear-gradient(45deg, #e0e0e0 25%, transparent 25%, transparent 75%, #e0e0e0 75%, #e0e0e0);
background-position: 0 0, 8px 8px;
/*rtl:end:ignore*/
background-size: 16px 16px;
}
.global-styles-ui__shadow-preview-block {
border: #ddd 1px solid;
border-radius: 2px;
background-color: #fff;
width: 60%;
height: 60px;
}
.global-styles-ui__text-shadow-preview-panel {
margin-block: -8px 16px;
}
.global-styles-ui__text-shadow-preview-text {
font-size: 24px;
}
.global-styles-ui__text-shadow-editor__header {
margin-block-end: 8px;
}
.global-styles-ui__text-shadow-editor__inputs {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16px;
}
.global-styles-ui__shadow-editor__dropdown-content,
.global-styles-ui__text-shadow-editor__dropdown-content {
width: 280px;
}
.global-styles-ui__shadow-editor-panel,
.global-styles-ui__text-shadow-editor-panel {
margin-bottom: 4px;
}
.global-styles-ui__shadow-editor__dropdown,
.global-styles-ui__text-shadow-editor__dropdown {
width: 100%;
position: relative;
}
.global-styles-ui__shadow-editor__dropdown-toggle,
.global-styles-ui__text-shadow-editor__dropdown-toggle {
width: 100%;
height: auto;
padding-top: 8px;
padding-bottom: 8px;
text-align: left;
border-radius: inherit;
}
.global-styles-ui__shadow-editor__dropdown-toggle.is-open,
.global-styles-ui__text-shadow-editor__dropdown-toggle.is-open {
background: #f0f0f0;
color: var(--wp-admin-theme-color);
}
.global-styles-ui__shadow-editor__remove-button,
.global-styles-ui__text-shadow-editor__remove-button {
position: absolute;
right: 8px;
top: 8px;
opacity: 0;
}
.global-styles-ui__shadow-editor__dropdown-toggle:hover + .global-styles-ui__shadow-editor__remove-button, .global-styles-ui__text-shadow-editor__dropdown-toggle:hover + .global-styles-ui__shadow-editor__remove-button, .global-styles-ui__shadow-editor__remove-button:focus, .global-styles-ui__shadow-editor__remove-button:hover,
.global-styles-ui__shadow-editor__dropdown-toggle:hover + .global-styles-ui__text-shadow-editor__remove-button,
.global-styles-ui__text-shadow-editor__dropdown-toggle:hover + .global-styles-ui__text-shadow-editor__remove-button,
.global-styles-ui__text-shadow-editor__remove-button:focus,
.global-styles-ui__text-shadow-editor__remove-button:hover {
opacity: 1;
}
@media (hover: none) {
.global-styles-ui__shadow-editor__remove-button,
.global-styles-ui__text-shadow-editor__remove-button {
opacity: 1;
}
}
.global-styles-ui-screen-css {
flex: 1 1 auto;
display: flex;
flex-direction: column;
margin: 16px;
}
.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel {
flex: 1 1 auto;
}
.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel__custom-css-input {
flex: 1 1 auto;
display: flex;
flex-direction: column;
}
.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel__custom-css-input .components-base-control__field {
flex: 1 1 auto;
display: flex;
flex-direction: column;
}
.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel__custom-css-input textarea {
flex: 1 1 auto;
}
.global-styles-ui-screen-css-help-link {
display: inline-block;
margin-top: 8px;
}
.global-styles-ui-screen-variations {
margin-top: 16px;
border-top: 1px solid #ddd;
}
.global-styles-ui-screen-variations > * {
margin: 24px 16px;
}
.global-styles-ui-sidebar__navigator-provider {
height: 100%;
}
.global-styles-ui-sidebar__navigator-screen {
display: flex;
flex-direction: column;
height: 100%;
}
.global-styles-ui-color-palette__tablist-container {
border-bottom: 1px solid #ddd;
}
.global-styles-ui-color-palette__tablist {
margin-bottom: -1px;
}
.global-styles-ui-sidebar__navigator-screen .single-column {
grid-column: span 1;
}
.global-styles-ui-screen-root.global-styles-ui-screen-root,
.global-styles-ui-screen-style-variations.global-styles-ui-screen-style-variations {
background: unset;
color: inherit;
}
.global-styles-ui-sidebar__panel .block-editor-block-icon svg {
fill: currentColor;
}
.global-styles-ui-screen-root__active-style-tile.global-styles-ui-screen-root__active-style-tile, .global-styles-ui-screen-root__active-style-tile.global-styles-ui-screen-root__active-style-tile .global-styles-ui-screen-root__active-style-tile-preview {
border-radius: 2px;
}
.global-styles-ui-screen-root__active-style-tile-preview {
clip-path: border-box;
}
.global-styles-ui-color-palette-panel,
.global-styles-ui-gradient-palette-panel,
.global-styles-ui-duotone-palette-panel {
padding: 16px;
}