2016-10-31 18:04:15 +00:00
|
|
|
//- 💫 CSS > COMPONENTS > CODE
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2016-10-03 18:19:13 +00:00
|
|
|
//- Code block
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2018-04-29 00:06:46 +00:00
|
|
|
.c-code-block,
|
2018-04-30 16:48:35 +00:00
|
|
|
.juniper-cell
|
2016-10-31 18:04:15 +00:00
|
|
|
background: $color-front
|
2017-10-03 12:14:52 +00:00
|
|
|
color: darken($color-back, 20)
|
2016-10-31 18:04:15 +00:00
|
|
|
padding: 0.75em 0
|
2017-10-03 12:14:52 +00:00
|
|
|
border-radius: $border-radius
|
2016-10-03 18:19:13 +00:00
|
|
|
overflow: auto
|
|
|
|
width: 100%
|
|
|
|
max-width: 100%
|
|
|
|
white-space: pre
|
|
|
|
direction: ltr
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2018-04-29 00:06:46 +00:00
|
|
|
.c-code-block--has-icon
|
|
|
|
padding: 0
|
|
|
|
display: flex
|
|
|
|
border-top-left-radius: 0
|
|
|
|
border-bottom-left-radius: 0
|
2017-05-21 11:22:34 +00:00
|
|
|
|
|
|
|
.c-code-block__icon
|
|
|
|
padding: 0 0 0 1rem
|
|
|
|
display: flex
|
|
|
|
justify-content: center
|
|
|
|
align-items: center
|
2017-05-28 14:36:42 +00:00
|
|
|
|
|
|
|
&.c-code-block__icon--border
|
|
|
|
border-left: 6px solid
|
|
|
|
|
2016-10-03 18:19:13 +00:00
|
|
|
//- Code block content
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2018-04-29 00:06:46 +00:00
|
|
|
.c-code-block__content,
|
2018-04-30 16:48:35 +00:00
|
|
|
.juniper-input,
|
2018-04-29 00:06:46 +00:00
|
|
|
.jp-OutputArea
|
2016-10-03 18:19:13 +00:00
|
|
|
display: block
|
2017-11-01 18:49:42 +00:00
|
|
|
font: normal normal 1.1rem/#{1.9} $font-code
|
2016-10-31 18:04:15 +00:00
|
|
|
padding: 1em 2em
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2018-04-29 00:06:46 +00:00
|
|
|
.c-code-block__content[data-prompt]:before,
|
|
|
|
content: attr(data-prompt)
|
|
|
|
margin-right: 0.65em
|
|
|
|
display: inline-block
|
|
|
|
vertical-align: middle
|
|
|
|
opacity: 0.5
|
|
|
|
|
2018-04-30 16:48:35 +00:00
|
|
|
//- Juniper
|
2018-04-29 00:06:46 +00:00
|
|
|
|
|
|
|
[data-executable]
|
|
|
|
margin-bottom: 0
|
|
|
|
|
2018-04-30 16:48:35 +00:00
|
|
|
.juniper-cell
|
|
|
|
border: 0
|
|
|
|
|
|
|
|
.juniper-input
|
|
|
|
padding: 0
|
|
|
|
|
|
|
|
.juniper-output
|
|
|
|
color: inherit
|
|
|
|
background: inherit
|
|
|
|
padding: 0
|
2018-04-29 00:06:46 +00:00
|
|
|
|
|
|
|
.jp-OutputArea
|
|
|
|
&:not(:empty)
|
|
|
|
padding: 2rem 2rem 1rem
|
|
|
|
border-top: 1px solid $color-dark
|
|
|
|
margin-top: 2rem
|
|
|
|
|
|
|
|
.entities, svg
|
|
|
|
white-space: initial
|
|
|
|
font-family: inherit
|
|
|
|
|
|
|
|
.entities
|
|
|
|
font-size: 1.35rem
|
|
|
|
|
|
|
|
.jp-OutputArea pre
|
|
|
|
font: inherit
|
2017-08-14 10:40:39 +00:00
|
|
|
|
2018-04-29 00:06:46 +00:00
|
|
|
.jp-OutputPrompt.jp-OutputArea-prompt
|
|
|
|
padding-top: 0.5em
|
|
|
|
margin-right: 1rem
|
|
|
|
font-family: inherit
|
|
|
|
font-weight: bold
|
|
|
|
|
2018-04-30 16:48:35 +00:00
|
|
|
.juniper-button
|
2018-04-29 00:06:46 +00:00
|
|
|
@extend .u-text-label, .u-text-label--dark
|
2018-04-30 16:48:35 +00:00
|
|
|
position: static
|
2018-04-29 00:06:46 +00:00
|
|
|
|
2018-04-30 16:48:35 +00:00
|
|
|
.juniper-wrapper
|
2018-04-29 00:06:46 +00:00
|
|
|
position: relative
|
|
|
|
|
2018-04-30 16:48:35 +00:00
|
|
|
.juniper-wrapper__text
|
2018-04-29 00:06:46 +00:00
|
|
|
@include position(absolute, top, right, 1.25rem, 1.25rem)
|
|
|
|
color: $color-subtle-dark
|
|
|
|
z-index: 10
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2017-10-03 12:14:52 +00:00
|
|
|
//- Code
|
|
|
|
|
2018-04-29 00:06:46 +00:00
|
|
|
code, .CodeMirror, .jp-RenderedText, .jp-OutputArea
|
2017-10-03 12:14:52 +00:00
|
|
|
-webkit-font-smoothing: subpixel-antialiased
|
|
|
|
-moz-osx-font-smoothing: auto
|
|
|
|
|
|
|
|
|
2016-10-03 18:19:13 +00:00
|
|
|
//- Inline code
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2017-10-03 12:14:52 +00:00
|
|
|
*:not(a):not(.c-code-block) > code
|
|
|
|
color: $color-dark
|
|
|
|
|
2016-10-31 18:04:15 +00:00
|
|
|
*:not(.c-code-block) > code
|
2017-10-03 12:14:52 +00:00
|
|
|
font-size: 90%
|
|
|
|
background-color: $color-subtle-light
|
|
|
|
padding: 0.2rem 0.4rem
|
|
|
|
border-radius: 0.25rem
|
|
|
|
font-family: $font-code
|
2016-10-31 18:04:15 +00:00
|
|
|
margin: 0
|
2017-03-26 09:14:36 +00:00
|
|
|
box-decoration-break: clone
|
2017-05-03 17:40:30 +00:00
|
|
|
white-space: nowrap
|
2016-10-31 18:04:15 +00:00
|
|
|
|
|
|
|
.c-aside__content &
|
2017-03-18 14:24:07 +00:00
|
|
|
background: lighten($color-front, 10)
|
2016-10-31 18:04:15 +00:00
|
|
|
color: $color-back
|
2017-03-26 09:14:36 +00:00
|
|
|
text-shadow: none
|
2016-10-03 18:19:13 +00:00
|
|
|
|
|
|
|
|
2018-04-29 00:06:46 +00:00
|
|
|
//- Syntax Highlighting (Prism)
|
2016-10-03 18:19:13 +00:00
|
|
|
|
|
|
|
[class*="language-"] .token
|
|
|
|
&.comment, &.prolog, &.doctype, &.cdata, &.punctuation
|
|
|
|
color: map-get($syntax-highlighting, comment)
|
|
|
|
|
|
|
|
&.property, &.tag, &.constant, &.symbol, &.deleted
|
|
|
|
color: map-get($syntax-highlighting, tag)
|
|
|
|
|
|
|
|
&.boolean, &.number
|
|
|
|
color: map-get($syntax-highlighting, number)
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2016-10-03 18:19:13 +00:00
|
|
|
&.selector, &.attr-name, &.string, &.char, &.builtin, &.inserted
|
|
|
|
color: map-get($syntax-highlighting, selector)
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2016-10-03 18:19:13 +00:00
|
|
|
@at-root .language-css .token.string,
|
|
|
|
&.operator, &.entity, &.url, &.variable
|
|
|
|
color: map-get($syntax-highlighting, operator)
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2016-10-03 18:19:13 +00:00
|
|
|
&.atrule, &.attr-value, &.function
|
|
|
|
color: map-get($syntax-highlighting, function)
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2016-10-03 18:19:13 +00:00
|
|
|
&.regex, &.important
|
|
|
|
color: map-get($syntax-highlighting, regex)
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2016-10-03 18:19:13 +00:00
|
|
|
&.keyword
|
|
|
|
color: map-get($syntax-highlighting, keyword)
|
2016-03-31 14:24:48 +00:00
|
|
|
|
2016-10-03 18:19:13 +00:00
|
|
|
&.italic
|
|
|
|
font-style: italic
|
2018-04-29 00:06:46 +00:00
|
|
|
|
|
|
|
//- Syntax Highlighting (CodeMirror)
|
|
|
|
|
|
|
|
.CodeMirror.cm-s-default
|
|
|
|
background: $color-front
|
|
|
|
color: darken($color-back, 20)
|
|
|
|
|
|
|
|
.CodeMirror-selected
|
|
|
|
background: $color-theme
|
|
|
|
color: $color-back
|
|
|
|
|
|
|
|
.CodeMirror-cursor
|
|
|
|
border-left-color: currentColor
|
|
|
|
|
|
|
|
.cm-variable-2
|
|
|
|
color: inherit
|
|
|
|
font-style: italic
|
|
|
|
|
|
|
|
.cm-comment
|
|
|
|
color: map-get($syntax-highlighting, comment)
|
|
|
|
|
|
|
|
.cm-keyword, .cm-builtin
|
|
|
|
color: map-get($syntax-highlighting, keyword)
|
|
|
|
|
|
|
|
.cm-operator
|
|
|
|
color: map-get($syntax-highlighting, operator)
|
|
|
|
|
|
|
|
.cm-string
|
|
|
|
color: map-get($syntax-highlighting, selector)
|
|
|
|
|
|
|
|
.cm-number
|
|
|
|
color: map-get($syntax-highlighting, number)
|
|
|
|
|
|
|
|
.cm-def
|
|
|
|
color: map-get($syntax-highlighting, function)
|
|
|
|
|
|
|
|
//- Syntax highlighting (Jupyter)
|
|
|
|
|
|
|
|
.jp-RenderedText pre
|
|
|
|
.ansi-cyan-fg
|
|
|
|
color: map-get($syntax-highlighting, function)
|
|
|
|
|
|
|
|
.ansi-green-fg
|
|
|
|
color: $color-green
|
|
|
|
|
|
|
|
.ansi-red-fg
|
|
|
|
color: map-get($syntax-highlighting, operator)
|