WordPress/wp-content/themes/twentytwentyone/assets/sass/02-tools/mixins.scss
desrosj 5bd111eb76 Twenty Twenty-One: Sync the latest changes for 5.6 RC2.
This will be the final sync from GitHub before placing that repository into read-only mode. All further changes should now flow entirely through Trac.

For a full list of changes since [49633], see 1d5a895...53acd9b.

Props poena, luminuu, kjellr, ryelle, allancole, melchoyce, felipeelia, aljullu, kebbet, chaton666, Clorith, mkaz, ingereck, paaljoachim.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49726


git-svn-id: http://core.svn.wordpress.org/trunk@49449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-01 19:09:05 +00:00

74 lines
1.7 KiB
SCSS

// Responsive breakpoints mixin
@mixin add_variables( $view: frontend ) {
@if frontend == $view {
:root {
@content;
}
}
@if editor == $view {
:root,
body {
@content;
}
}
}
// Button style
// - Applies button styles to blocks and elements that share them.
@mixin button-style() {
line-height: var(--button--line-height);
color: var(--button--color-text);
cursor: pointer;
font-weight: var(--button--font-weight);
font-family: var(--button--font-family);
font-size: var(--button--font-size);
background-color: var(--button--color-background);
border-radius: var(--button--border-radius);
border: var(--button--border-width) solid var(--button--color-background);
text-decoration: none;
padding: var(--button--padding-vertical) var(--button--padding-horizontal);
&:focus {
background: transparent;
outline-offset: -6px;
outline: 2px dotted currentColor;
.is-dark-theme & {
color: var(--button--color-background);
}
&:not(.has-background) {
color: var(--button--color-text-hover);
}
}
&:disabled {
background-color: var(--global--color-white-50);
border-color: var(--global--color-white-50);
color: var(--button--color-text-active);
}
}
@mixin innerblock-margin-clear($container) {
// Clear the top margin for the first-child.
> #{$container} > *:first-child {
margin-top: 0;
}
// Last child that is not the appender.
> #{$container} > *:last-child:not(.block-list-appender) {
margin-bottom: 0;
}
// When selected, the last item becomes the second last because of the appender.
&.has-child-selected > #{$container} > *:nth-last-child(2),
&.is-selected > #{$container} > *:nth-last-child(2) {
margin-bottom: 0;
}
}