2023-06-02 16:53:32 +02:00
|
|
|
@use 'sass:color';
|
2023-05-31 18:10:09 +02:00
|
|
|
@use '../breakpoints';
|
2023-06-02 16:53:32 +02:00
|
|
|
@use '../config/color/brand';
|
2023-06-12 16:23:41 +02:00
|
|
|
@use '../visual-design/typography';
|
2023-05-31 18:10:09 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
.playground {
|
2023-06-13 00:19:24 +02:00
|
|
|
--sl-container-max-width: 100vw;
|
2023-06-13 16:44:48 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
display: grid;
|
|
|
|
grid-template:
|
|
|
|
'header' auto
|
|
|
|
'main' 1fr
|
|
|
|
'footer' auto / 100%;
|
|
|
|
min-height: 100vh;
|
|
|
|
|
|
|
|
#main-content {
|
|
|
|
display: grid;
|
|
|
|
grid-template:
|
2023-06-13 16:44:48 +02:00
|
|
|
'editor' 1fr
|
|
|
|
'alert' min-content;
|
2023-06-12 18:59:27 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-13 00:19:24 +02:00
|
|
|
.sl-r-banner__playground-title {
|
|
|
|
// Use smaller sizes for condensed header
|
2023-06-12 16:23:41 +02:00
|
|
|
--h1-size: var(--sl-font-size--xx-large);
|
|
|
|
--h1-size-lg: var(--sl-playground-heading);
|
2023-06-13 16:44:48 +02:00
|
|
|
|
2023-06-13 00:19:24 +02:00
|
|
|
margin-bottom: 0;
|
|
|
|
flex: 1;
|
2023-06-12 16:23:41 +02:00
|
|
|
}
|
2023-06-09 18:24:33 +02:00
|
|
|
|
2023-06-13 00:19:24 +02:00
|
|
|
// Playground banner actions area
|
|
|
|
.sl-r-banner__playground-actions {
|
2023-06-12 18:59:27 +02:00
|
|
|
flex-direction: row-reverse;
|
2023-06-13 00:19:24 +02:00
|
|
|
gap: var(--sl-gutter);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Playground banner actions alert message
|
|
|
|
.sl-r-banner__playground-alert {
|
|
|
|
padding-left: var(--sl-gutter);
|
|
|
|
padding-right: var(--sl-gutter);
|
2023-06-13 16:44:48 +02:00
|
|
|
position: var(--playground-alert-position, absolute);
|
2023-06-13 00:19:24 +02:00
|
|
|
right: var(--playground-alert-right, 0);
|
|
|
|
top: -50%;
|
|
|
|
|
|
|
|
&.show {
|
|
|
|
top: auto;
|
|
|
|
right: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (width >= 1065px) {
|
|
|
|
&.show {
|
|
|
|
--playground-alert-position: relative;
|
|
|
|
}
|
|
|
|
}
|
2023-06-12 18:59:27 +02:00
|
|
|
}
|
2023-05-31 18:10:09 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
#playground-copied-alert {
|
|
|
|
opacity: 0;
|
2023-06-13 00:19:24 +02:00
|
|
|
transition: opacity 0.3s;
|
2023-06-09 18:24:33 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
&.show {
|
|
|
|
opacity: 1;
|
2023-05-31 18:10:09 +02:00
|
|
|
}
|
|
|
|
}
|
2023-06-02 16:53:32 +02:00
|
|
|
|
2023-06-13 00:19:24 +02:00
|
|
|
.sl-l-section--playground {
|
|
|
|
display: grid;
|
|
|
|
width: 100%;
|
2023-06-12 16:28:38 +02:00
|
|
|
}
|
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
// Playground Editor area
|
|
|
|
.sl-c-playground {
|
|
|
|
--sl-c-callout--block-margin: 0;
|
2023-06-13 00:19:24 +02:00
|
|
|
--sl-c-callout--block-padding: var(--sl-gutter--quarter);
|
2023-06-13 16:44:48 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
display: grid;
|
2023-06-02 16:53:32 +02:00
|
|
|
gap: var(--sl-gutter);
|
2023-06-13 00:19:24 +02:00
|
|
|
grid-template:
|
|
|
|
'sass' 1fr
|
|
|
|
'css' auto
|
|
|
|
'debug' auto / 100%;
|
2023-06-02 16:53:32 +02:00
|
|
|
|
2023-06-13 00:19:24 +02:00
|
|
|
@include breakpoints.sl-breakpoint--large {
|
2023-06-12 18:59:27 +02:00
|
|
|
grid-template:
|
|
|
|
'sass css' 1fr
|
2023-06-13 00:19:24 +02:00
|
|
|
'debug debug' minmax(0, auto) / 1fr 1fr;
|
2023-06-02 16:53:32 +02:00
|
|
|
}
|
2023-06-12 18:59:27 +02:00
|
|
|
}
|
2023-06-02 18:52:24 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
// 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;
|
|
|
|
}
|
2023-06-06 22:25:37 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
.sl-c-playground__console-wrapper {
|
|
|
|
grid-area: debug;
|
|
|
|
min-width: calc((100% - var(--sl-gutter)) / 2);
|
|
|
|
}
|
2023-06-07 21:45:42 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
[data-code='precompiled'] {
|
|
|
|
--sl-color-editor-background: var(--sl-color--white);
|
2023-06-13 16:44:48 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
grid-template-rows: min-content 1fr;
|
|
|
|
}
|
2023-06-07 21:13:23 +02:00
|
|
|
|
2023-06-13 16:44:48 +02:00
|
|
|
[data-code='compiled'] {
|
2023-06-12 18:59:27 +02:00
|
|
|
--sl-color-editor-background: var(--sl-color--code-background);
|
2023-06-13 16:44:48 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
grid-template-rows: min-content minmax(0, auto) 1fr;
|
|
|
|
}
|
2023-06-07 21:13:23 +02:00
|
|
|
|
2023-06-13 18:42:28 +02:00
|
|
|
// Codemirror overrides
|
|
|
|
.cm-editor {
|
2023-06-13 00:19:24 +02:00
|
|
|
height: 100%;
|
2023-06-13 18:42:28 +02:00
|
|
|
font-size: var(--sl-font-size--x-small);
|
|
|
|
background-color: var(--sl-color-editor-background);
|
2023-06-14 19:00:06 +02:00
|
|
|
color: var(--sl-color--code-base, var(--sl-color--code-text));
|
2023-06-13 18:42:28 +02:00
|
|
|
|
|
|
|
&.cm-focused {
|
|
|
|
// override focus style
|
|
|
|
}
|
|
|
|
|
|
|
|
.cm-gutters {
|
|
|
|
background-color: var(--sl-color-editor-background);
|
|
|
|
border-right: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.cm-content,
|
|
|
|
.cm-tooltip-lint {
|
|
|
|
font-family: typography.$sl-font-family--code;
|
|
|
|
}
|
|
|
|
|
|
|
|
.cm-scroller {
|
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.cm-activeLine {
|
|
|
|
background-color: #cef4;
|
|
|
|
}
|
|
|
|
|
|
|
|
.cm-activeLineGutter {
|
|
|
|
background-color: #e2f2ff;
|
|
|
|
}
|
2023-06-13 00:19:24 +02:00
|
|
|
}
|
2023-06-12 18:59:27 +02:00
|
|
|
|
|
|
|
#editor {
|
|
|
|
cursor: text;
|
2023-06-12 16:28:38 +02:00
|
|
|
}
|
2023-06-07 21:13:23 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
.console {
|
2023-06-12 20:38:42 +02:00
|
|
|
font-family: typography.$sl-font-family--code;
|
2023-06-12 18:59:27 +02:00
|
|
|
min-height: 2em;
|
|
|
|
max-height: 500px;
|
|
|
|
margin: 0;
|
2023-06-02 18:52:24 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
hr,
|
|
|
|
p {
|
|
|
|
margin: 0;
|
|
|
|
}
|
2023-06-06 22:25:37 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
$console-type-colors: (
|
|
|
|
'error': red,
|
|
|
|
'warn': orange,
|
|
|
|
'debug': green,
|
|
|
|
);
|
2023-06-12 16:28:38 +02:00
|
|
|
|
2023-06-12 18:59:27 +02:00
|
|
|
@each $name, $color in $console-type-colors {
|
|
|
|
.console-type-#{$name} {
|
|
|
|
color: $color;
|
2023-06-02 18:52:24 +02:00
|
|
|
}
|
2023-06-12 16:28:38 +02:00
|
|
|
}
|
2023-06-07 21:13:23 +02:00
|
|
|
|
2023-06-12 20:38:27 +02:00
|
|
|
> div {
|
|
|
|
display: flex;
|
|
|
|
}
|
2023-06-02 18:52:24 +02:00
|
|
|
|
2023-06-12 20:38:27 +02:00
|
|
|
.console-location {
|
|
|
|
min-width: 7em;
|
|
|
|
}
|
2023-06-12 18:59:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.sl-c-playground__editor-tabbar {
|
|
|
|
background-color: var(--sl-color--code-background-darker);
|
2023-06-13 00:19:24 +02:00
|
|
|
display: flex;
|
2023-06-12 18:59:27 +02:00
|
|
|
|
|
|
|
$sassoptions: 'scss', 'indented';
|
2023-06-13 16:44:48 +02:00
|
|
|
|
2023-06-12 16:28:38 +02:00
|
|
|
@each $option in $sassoptions {
|
|
|
|
&[data-active='#{$option}'] [data-value='#{$option}'] {
|
2023-06-13 00:19:24 +02:00
|
|
|
--color-tab-background: var(--sl-color--white);
|
2023-06-12 18:59:27 +02:00
|
|
|
--color-button-text: var(--text, var(--sl-color--pale-sky));
|
2023-06-02 18:52:24 +02:00
|
|
|
}
|
|
|
|
}
|
2023-06-05 20:40:15 +02:00
|
|
|
|
2023-06-12 16:28:38 +02:00
|
|
|
$cssoptions: 'expanded', 'compressed';
|
2023-06-13 16:44:48 +02:00
|
|
|
|
2023-06-12 16:28:38 +02:00
|
|
|
@each $option in $cssoptions {
|
|
|
|
&[data-active='#{$option}'] [data-value='#{$option}'] {
|
2023-06-13 00:19:24 +02:00
|
|
|
--color-tab-background: var(--sl-color--code-background);
|
2023-06-12 18:59:27 +02:00
|
|
|
--color-button-text: var(--text, var(--sl-color--pale-sky));
|
2023-06-12 16:28:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-06-05 20:40:15 +02:00
|
|
|
|
2023-06-12 16:28:38 +02:00
|
|
|
#code-editor-error-alert {
|
|
|
|
display: none;
|
|
|
|
font-weight: typography.$sl-font-weight--bold;
|
|
|
|
|
2023-06-13 00:19:24 +02:00
|
|
|
[data-compiler-has-error='true'] & {
|
2023-06-12 16:28:38 +02:00
|
|
|
display: block;
|
2023-06-05 20:40:15 +02:00
|
|
|
}
|
2023-06-02 16:53:32 +02:00
|
|
|
}
|
2023-06-12 16:28:38 +02:00
|
|
|
|
2023-06-13 00:19:24 +02:00
|
|
|
// Make sure all tab bar buttons and text get the same padding
|
2023-06-12 16:28:38 +02:00
|
|
|
[data-tabbar~='item'] {
|
|
|
|
padding: var(--sl-gutter--half);
|
|
|
|
}
|
2023-06-13 00:19:24 +02:00
|
|
|
|
|
|
|
.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);
|
2023-06-14 19:00:06 +02:00
|
|
|
font-weight: normal;
|
2023-06-13 00:19:24 +02:00
|
|
|
letter-spacing: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[data-code='compiled'] &:last-child {
|
|
|
|
margin-left: auto;
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
}
|