Browse Source

Fix busted code blocks

image-sizing
Logan McGrath 3 months ago
parent
commit
8c6ed37d34
  1. 2
      green.cabal
  2. 2
      package.yaml
  3. 48
      site/css/elements/_code.scss

2
green.cabal

@ -10,7 +10,7 @@ description: Please see the README at <https://bitsof.thisfieldwas.green/keyw
author: Logan McGrath
maintainer: website@thisfieldwas.green
copyright: Copyright (C) 2012-2021 Logan McGrath
license: bsd-3-clause
license: BSD3
build-type: Simple
extra-source-files:
README.md

2
package.yaml

@ -1,7 +1,7 @@
name: green
version: 0.1.0.0
git: https://bitsof.thisfieldwas.green/keywordsalad/thisfieldwas.green
license: bsd-3-clause
license: BSD3
author: Logan McGrath
maintainer: "website@thisfieldwas.green"
copyright: "Copyright (C) 2012-2021 Logan McGrath"

48
site/css/elements/_code.scss

@ -58,9 +58,14 @@ div.sourceCode {
}
code.sourceCode {
font-size: 0;
display: block;
margin: 0 3rem;
margin: 1rem 0;
padding: 0;
font-size: 0;
white-space: pre;
overflow: scroll;
border-top: $border-regular;
border-bottom: $border-thin;
.numberLines & {
padding-left: 0;
@ -68,27 +73,15 @@ code.sourceCode {
}
> span {
background-color: beige;
display: flex;
width: 100%;
padding: 0 0.5rem;
display: block;
white-space: pre;
font-size: $code-font-size;
&:first-child {
padding-top: 0.5rem;
border-top: $border-regular;
padding-top: 0.3rem;
}
&:last-child {
padding-bottom: 0.5rem;
border-bottom: $border-thin;
}
> a:first-child {
color: $color-emphasize;
}
> *:not(a:first-child) {
width: auto;
padding-bottom: 0.3rem;
}
.numberLines & {
@ -105,14 +98,17 @@ code.sourceCode {
background-color: $color-highlight;
}
> a:first-child::before {
display: inline-block;
width: 2rem;
margin-left: -3rem;
margin-right: 1rem;
text-align: right;
content: counter(line-number);
user-select: none;
> a:first-child {
&::before {
display: inline-block;
width: 2rem;
padding: 0 0.5rem 0 0;
margin: 0 0.5rem 0 0;
border-right: $border-thin;
text-align: right;
content: counter(line-number);
user-select: none;
}
}
}
}

Loading…
Cancel
Save