@use 'sass:color'; @use '../breakpoints'; @use '../config/color/brand'; @use '../visual-design/typography'; .playground { --sl-container-max-width: 100vw; display: grid; grid-template: 'header' min-content 'main' 1fr 'footer' min-content / 100%; max-height: 100vh; overflow: hidden; #main-content { display: inherit; overflow: inherit; } .site-footer { --sl-type-margin-block: var(--sl-gutter--quarter); p { padding-top: var(--sl-gutter--minus); } } } .sl-l-section--playground { --container-inline-padding: 0; --container-inline-padding-large: 0; display: inherit; overflow: inherit; width: 100%; } .sl-r-banner__playground-title { // Use smaller sizes for condensed header --h1-size: var(--sl-font-size--xx-large); --h1-size-lg: var(--sl-playground-heading); margin-bottom: 0; flex: 1; } // Playground banner actions area .sl-r-banner__playground-actions { flex-direction: row-reverse; gap: var(--sl-gutter); } // Playground banner actions alert message .sl-r-banner__playground-alert { padding-left: var(--sl-gutter); padding-right: var(--sl-gutter); position: var(--playground-alert-position, absolute); right: var(--playground-alert-right, 0); top: -50%; &.show { right: auto; top: auto; } @media screen and (width >= 1065px) { &.show { --playground-alert-position: relative; } } } #playground-copied-alert { opacity: 0; transition: opacity 0.3s; &.show { opacity: 1; } } // Playground Editor area .sl-c-playground { --sl-c-callout--block-margin: 0; --sl-c-callout--block-padding: var(--sl-gutter--quarter); display: grid; gap: var(--sl-gutter); grid-template: 'sass' 1fr 'css' auto 'debug' auto / 100%; overflow: inherit; @include breakpoints.sl-breakpoint--large { grid-template: 'sass css' 1fr 'debug debug' minmax(0, auto) / 1fr 1fr; } } // Precompiled and Compiled code container .sl-c-playground__code-editor-wrapper { background-color: var(--sl-color-editor-background); border: var(--sl-border--small) solid var(--sl-color--code-background-darker); display: grid; overflow: inherit; } [data-code='precompiled'] { --sl-color-editor-background: var(--sl-color--white); grid-template-rows: min-content 1fr; } [data-code='compiled'] { --sl-color-editor-background: var(--sl-color--code-background); grid-template: 'editor-tabbar' min-content 'editor-error' min-content 'editor-code' 1fr / 1fr; } .sl-code-is-compiled { grid-area: editor-code; } // Codemirror overrides .cm-editor { background-color: var(--sl-color-editor-background); color: var(--sl-color--code-base, var(--sl-color--code-text)); font-size: var(--sl-font-size--x-small); height: auto; overflow-x: auto; overflow-y: inherit; .cm-gutters { background-color: var(--sl-color-editor-background); border-right: none; } .cm-lineNumbers .cm-gutterElement { min-width: var(--sl-gutter--double); } .cm-content, .cm-tooltip-lint { font-family: typography.$sl-font-family--code; } .cm-scroller { overflow: unset; } .cm-line { padding-left: var(--sl-gutter); } .cm-activeLineGutter, .cm-activeLine { background-color: var(--sl-color--highlight-blush); [data-code='compiled'] & { background-color: var(--sl-color--code-background); } } &.cm-focused { [data-code='precompiled'] & { outline: 1px solid var(--sl-color--border-blush); } [data-code='compiled'] & { outline: 0; } } .sl-code-is-precompiled & { cursor: text; } } .sl-code-is-precompiled { overflow: hidden auto; } // Compiled CSS error .sl-c-playground__error { display: none; font-weight: typography.$sl-font-weight--bold; [data-compiler-has-error='true'] & { display: block; } } // Console specific styles .sl-c-playground__console-wrapper { grid-area: debug; } .sl-c-playground__console { font-family: typography.$sl-font-family--code; margin: 0; max-height: 500px; min-height: 2em; .console-line { display: grid; gap: var(--sl-gutter); grid-template: 'location message' auto / 10ch 1fr; } .console-message { display: grid; } $console-type-colors: ( 'error': var(--sl-color--error), 'warn': var(--sl-color--warn), 'debug': var(--sl-color--success), ); @each $name, $color in $console-type-colors { .console-type-#{$name} { color: $color; } } } // Playground Tab Bar & Buttons .sl-c-playground__editor-tabbar { background-color: var(--sl-color--code-background-darker); display: flex; [data-active='true'] { --color-button-tab-active: var(--text, var(--sl-color--pale-sky)); --color-tab-focus: var(--color-button-tab-active); } [data-code='precompiled'] & { [data-active='true'] { --color-tab-background: var(--sl-color--white); --color-tab-background-hover: var(--sl-color--white); } } [data-code='compiled'] & { [data-active='true'] { --color-tab-background: var(--sl-color--code-background); --color-tab-background-hover: var(--sl-color--code-background); } } } // Make sure all tab bar buttons and text get the same padding [data-tabbar~='item'] { padding: var(--sl-gutter--half) var(--sl-gutter); } .sl-c-playground__tabbar-title { // For nested caps in tab title, reset a few styles .caps { --sl-font-size--caps: var(--sl-font-size--medium); font-weight: normal; letter-spacing: 0; } [data-code='compiled'] &:last-child { margin-left: auto; text-align: right; } } .sl-c-footer-link-grid { align-items: center; display: grid; gap: var(--sl-gutter); grid-template-columns: minmax(var(--twitter-link-width), auto) 1fr; @include breakpoints.sl-breakpoint--large { grid-template-columns: minmax(var(--twitter-link-width), auto) minmax(var(--mac-stadium-icon-width), auto); } }