sass-site/source/assets/sass/components/_playground.scss
2023-06-09 12:24:33 -04:00

127 lines
2.7 KiB
SCSS

@use 'sass:color';
@use '../breakpoints';
@use '../config/color/brand';
// Use h2 sizes for condensed header
.sl-r-banner-playground {
h1 {
@include breakpoints.sl-breakpoint--medium {
--h1-size: var(--sl-font-size--xx-large);
}
@include breakpoints.sl-breakpoint--large {
--h1-size: var(--sl-font-size--xxx-large);
}
}
button#playground-copy-url {
float: right;
}
#playground-copied-alert {
opacity: 0;
float: right;
transition: opacity 0.3s linear;
&.show {
opacity: 1;
}
}
}
.playground-wrapper {
display: flex;
flex-flow: row wrap;
gap: var(--sl-gutter);
> div {
// Duplicated from fun fact- should this be defined elsewhere?
border: var(--sl-border--small) solid
color.adjust(brand.$sl-color--patina, $lightness: 32%);
flex-grow: 1;
min-width: calc((100% - var(--sl-gutter)) / 2);
}
#editor {
--sl-color-editor-background: white;
cursor: text;
}
#css-view {
--sl-color-editor-background: var(--sl-color--code-background);
}
.console {
font-family: 'Source Code Pro', 'SF Mono', monaco, inconsolata, 'Fira Mono',
'Droid Sans Mono', monospace;
min-height: 2em;
max-height: 500px;
margin: 0;
hr,
p {
margin: 0;
}
$console-type-colors: (
'error': red,
'warn': orange,
'debug': green,
);
@each $name, $color in $console-type-colors {
.console-type-#{$name} {
color: $color;
}
}
}
.code-editor-tabbar {
background-color: color.adjust(brand.$sl-color--patina, $lightness: 32%);
button {
background-color: color.adjust(brand.$sl-color--patina, $lightness: 32%);
font-weight: bold;
color: var(--text, var(--sl-color--pale-sky));
padding: var(--sl-gutter--half);
border: 0;
cursor: pointer;
&:hover {
// TODO- add hover styles
}
}
$options: 'scss', 'indented', 'expanded', 'compressed';
@each $option in $options {
&[data-active='#{$option}'] [data-value='#{$option}'] {
background-color: var(--sl-color--code-background);
}
}
}
#code-editor-error-alert {
display: none;
// From warning callout
background: color.adjust(brand.$sl-color--hopbush, $lightness: 38%);
border: var(--sl-border--small) solid
color.adjust(brand.$sl-color--hopbush, $lightness: 27%);
font-family: 'Source Code Pro', 'SF Mono', monaco, inconsolata, 'Fira Mono',
'Droid Sans Mono', monospace;
font-size: var(--sl-font-size--x-small);
padding: var(--sl-gutter--half);
// TODO Font weight bold not imported from Google Fonts
font-weight: bold;
}
&[data-compiler-has-error='true'] {
#code-editor-error-alert {
display: block;
}
}
}