org-theme/scss/partials/_codes.scss

134 lines
2.9 KiB
SCSS
Raw Permalink Normal View History

2020-11-26 13:42:06 +01:00
@mixin src-box {
display: inline;
position: absolute;
2020-11-27 15:16:19 +01:00
color: $color-text-shadow;
background-color: $white;
2020-11-26 13:42:06 +01:00
padding: 0px 4px;
2020-11-27 15:16:19 +01:00
border: 1px solid $color-shadow;
2020-12-13 22:48:06 +01:00
font-size: 0.6rem;
2020-11-26 13:42:06 +01:00
top: -9px;
z-index: 10;
2020-11-27 15:16:19 +01:00
font-family: $mono;
2020-11-26 13:42:06 +01:00
}
2020-11-25 23:22:07 +01:00
2020-11-26 13:42:06 +01:00
// Div that containst the code
.org-src-container {
2020-11-26 10:59:38 +01:00
position: relative;
overflow: visible;
2020-11-26 13:42:06 +01:00
margin-top: 1em;
2020-11-26 10:59:38 +01:00
2020-11-26 15:58:26 +01:00
// Caption
label {
text-align: center;
cursor: text;
2020-12-13 22:48:06 +01:00
font-size: 0.85rem;
2020-11-27 15:16:19 +01:00
font-family: $serif;
font-style: italic;
color: $color-caption;
2020-11-26 15:58:26 +01:00
2020-11-26 19:57:26 +01:00
// Listing num
2020-11-26 15:58:26 +01:00
.listing-number {
2020-11-27 15:16:19 +01:00
font-weight: $bold;
color: $color-caption-num;
2020-11-26 15:58:26 +01:00
}
}
2020-11-26 13:42:06 +01:00
// Copy Button
2020-11-26 10:59:38 +01:00
div.src-copy {
2020-11-26 13:42:06 +01:00
@include src-box;
2020-11-26 10:59:38 +01:00
line-height:1.5;
right: 10px;
cursor: pointer;
2020-11-26 15:58:26 +01:00
// When button is clicked
&.src-copied {
2020-11-27 15:16:19 +01:00
color: $color-text-invert;
2020-11-26 19:57:26 +01:00
background-color: $color-primary;
2020-11-26 15:58:26 +01:00
}
2020-11-26 10:59:38 +01:00
}
2020-11-27 18:31:19 +01:00
// Line numbers
2020-11-27 18:32:10 +01:00
.linenr {
2020-11-27 18:31:19 +01:00
color: $color-text-shadow;;
}
2020-11-26 13:42:06 +01:00
// Code Block
2020-11-25 23:22:07 +01:00
> pre {
position: relative;
overflow: visible;
2020-11-27 15:16:19 +01:00
border:1px solid $color-shadow;
background: $white;
display: block;
font-family: $mono;
2020-12-13 22:48:06 +01:00
font-size: 0.75rem;
2020-11-27 15:16:19 +01:00
line-height: 1.5;
padding: 12px;
2020-11-26 13:42:06 +01:00
margin-bottom: 24px;
white-space: pre-wrap; // Wrap long Line
2020-11-25 23:22:07 +01:00
2020-11-26 13:42:06 +01:00
// Box containing language Names
2020-11-25 23:22:07 +01:00
&.src:before {
2020-11-26 13:42:06 +01:00
@include src-box;
2020-11-25 23:22:07 +01:00
left: 10px;
}
2020-11-26 13:42:06 +01:00
// Languages Names
2020-11-25 23:22:07 +01:00
&.src-emacs-lisp:before { content: 'Emacs Lisp'; }
2020-11-26 13:42:06 +01:00
&.src-elisp:before { content: 'Emacs Lisp'; }
&.src-sh:before { content: 'shell'; }
&.src-bash:before { content: 'bash'; }
&.src-org:before { content: 'Org mode'; }
&.src-python:before { content: 'Python'; }
&.src-latex:before { content: 'LaTeX'; }
&.src-matlab:before { content: 'Matlab'; }
2020-11-26 15:58:26 +01:00
&.src-bibtex:before { content: 'BibTeX'; }
2020-11-25 23:22:07 +01:00
}
}
2020-11-26 13:42:06 +01:00
// Results blocks
2020-11-25 23:22:07 +01:00
pre {
&.example {
position: relative;
2020-11-27 15:16:19 +01:00
background: $color-background;
border: 1px solid $color-shadow;
color: $color-text;
2020-12-13 22:48:06 +01:00
font-size: 0.75rem;
2020-11-25 23:22:07 +01:00
line-height: 1.5;
2020-11-27 15:16:19 +01:00
margin-bottom: 24px;
padding: 12px;
font-family: $mono;
2020-11-26 13:42:06 +01:00
//
2020-11-25 23:22:07 +01:00
&:before {
2020-11-26 13:42:06 +01:00
@include src-box;
content: "Results";
2020-11-25 23:22:07 +01:00
display: inline;
left: 10px;
}
}
}
2020-11-26 19:57:26 +01:00
// Additional Formating of the code itself
2020-11-25 23:22:07 +01:00
.org-type {
color: #228b22;
}
.org-comment {
color: #999988; font-style: italic;
}
.org-comment-delimiter {
color: #999988; font-style: italic;
}
.org-string {
color: #dd1144;
}
.org-matlab-cellbreak {
text-decoration: underline;
text-decoration-color: #999988;
}
.org-constant {
color: #008b8b;
}
.org-variable-name {
color: teal;
}