sass-site/source/assets/sass/components/_playground.scss

123 lines
2.7 KiB
SCSS
Raw Normal View History

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 16:23:41 +02:00
// Use smaller sizes for condensed header
2023-06-09 18:24:33 +02:00
.sl-r-banner-playground {
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-09 18:24:33 +02:00
button#playground-copy-url {
float: right;
2023-05-31 18:10:09 +02:00
}
2023-06-09 18:24:33 +02:00
#playground-copied-alert {
opacity: 0;
float: right;
transition: opacity 0.3s linear;
&.show {
opacity: 1;
}
2023-05-31 18:10:09 +02:00
}
}
2023-06-02 16:53:32 +02:00
.playground-wrapper {
display: flex;
2023-06-07 21:45:42 +02:00
flex-flow: row wrap;
2023-06-02 16:53:32 +02:00
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%);
2023-06-07 21:45:42 +02:00
flex-grow: 1;
min-width: calc((100% - var(--sl-gutter)) / 2);
2023-06-02 16:53:32 +02:00
}
2023-06-06 22:25:37 +02:00
#editor {
2023-06-07 21:45:42 +02:00
--sl-color-editor-background: white;
2023-06-06 22:25:37 +02:00
cursor: text;
}
2023-06-07 21:45:42 +02:00
#css-view {
--sl-color-editor-background: var(--sl-color--code-background);
}
2023-06-07 21:13:23 +02:00
.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;
2023-06-06 22:25:37 +02:00
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;
}
}
2023-06-02 16:53:32 +02:00
}