Better codes in details

This commit is contained in:
Thomas Dehaeze 2020-11-26 13:42:06 +01:00
parent 8a852c1147
commit 712e1ebaf6
2 changed files with 40 additions and 42 deletions

View File

@ -1,26 +1,32 @@
.org-src-container { @mixin src-box {
display: inline;
position: relative;
overflow: visible;
div.src-copy {
font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;
font-size:10px;
line-height:1.5;
position: absolute; position: absolute;
color: #808080; color: #808080;
background-color: white; background-color: white;
top: -8px;
right: 10px;
padding: 0px 4px; padding: 0px 4px;
border: 1px solid #d0d0d0; border: 1px solid #d0d0d0;
font-size:10px;
top: -9px;
z-index: 10; z-index: 10;
border-radius: 3px; font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;
}
// Div that containst the code
.org-src-container {
position: relative;
overflow: visible;
margin-top: 1em;
// Copy Button
div.src-copy {
@include src-box;
line-height:1.5;
right: 10px;
cursor: pointer; cursor: pointer;
} }
// Code Block
> pre { > pre {
margin-top: 1.5em;
position: relative; position: relative;
overflow: visible; overflow: visible;
border:1px solid #e1e4e5; border:1px solid #e1e4e5;
@ -29,35 +35,29 @@
font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace; font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;
font-size:12px; font-size:12px;
line-height:1.5; line-height:1.5;
margin:1px 0px 24px 0px;
padding:12px; padding:12px;
white-space:pre; margin-bottom: 24px;
white-space: pre-wrap; // Wrap long Line
// Box containing language Names
&.src:before { &.src:before {
display: inline; @include src-box;
position: absolute;
color: #808080;
background-color: white;
top: -10px;
left: 10px; left: 10px;
padding: 0px 4px;
border: 1px solid #d0d0d0;
font-size: 80%;
} }
// Languages Names
&.src-emacs-lisp:before { content: 'Emacs Lisp'; } &.src-emacs-lisp:before { content: 'Emacs Lisp'; }
&.src-elisp:before { content: 'Emacs Lisp'; } &.src-elisp:before { content: 'Emacs Lisp'; }
&.src-sh:before { content: 'shell'; } &.src-sh:before { content: 'shell'; }
&.src-bash:before { content: 'bash'; } &.src-bash:before { content: 'bash'; }
&.src-org:before { content: 'Org mode'; } &.src-org:before { content: 'Org mode'; }
&.src-python:before { content: 'Python'; } &.src-python:before { content: 'Python'; }
&.src-latex:before { content: 'LaTeX'; }
&.src-matlab:before { content: 'Matlab'; } &.src-matlab:before { content: 'Matlab'; }
} }
} }
// Results blocks
/* Results blocks */
pre { pre {
&.example { &.example {
position: relative; position: relative;
@ -68,21 +68,20 @@ pre {
line-height: 1.5; line-height: 1.5;
margin-bottom:24px; margin-bottom:24px;
padding:12px; padding:12px;
//
&:before { &:before {
content: 'Result'; @include src-box;
content: "Results";
display: inline; display: inline;
position: absolute;
color: #808080;
background-color: white;
top: -10px;
left: 10px; left: 10px;
padding: 0px 4px;
border: 1px solid #d0d0d0;
font-size: 80%;
} }
} }
} }
.org-type { .org-type {
color: #228b22; color: #228b22;
} }

View File

@ -6,9 +6,8 @@ details {
margin-bottom: 1.0em; margin-bottom: 1.0em;
pre.src { pre.src {
border: 0; margin-top: 12px;
background: none; margin-bottom: 0;
margin: 0;
} }
} }