|
| 1 | +/* |
| 2 | + * Customise the style of code blocks |
| 3 | + */ |
| 4 | + |
| 5 | +pre, .pre { |
| 6 | + /* |
| 7 | + * The default font stack in wagtail isn't that readable on some devices. |
| 8 | + */ |
| 9 | + font-family: 'JetBrains Mono', monospace; |
| 10 | + /* Bootstrap sizes `code` inline smaller than the text surrounding it, which looks |
| 11 | + odd when we use it for things like "Behat will set up a `features` directory". |
| 12 | + */ |
| 13 | + font-size: 1rem; |
| 14 | +} |
| 15 | + |
| 16 | + |
| 17 | +.highlight { |
| 18 | + pre { |
| 19 | + background-color: var(--bh-code-bg); |
| 20 | + color: var(--bh-code-text); |
| 21 | + /* big code blocks can be very slightly smaller in font to fit wider line width */ |
| 22 | + font-size: 0.9rem; |
| 23 | + } |
| 24 | + |
| 25 | + .c, /* Comment */ |
| 26 | + .cm, /* Comment.Multiline */ |
| 27 | + .cp, /* Comment.Preproc */ |
| 28 | + .c1, /* Comment.Single */ |
| 29 | + .cs /* Comment.Special */ |
| 30 | + { |
| 31 | + color: var(--bh-code-comment); |
| 32 | + } |
| 33 | + |
| 34 | + .k, /* Keyword */ |
| 35 | + .kc, /* Keyword.Constant */ |
| 36 | + .kd, /* Keyword.Declaration */ |
| 37 | + .kp, /* Keyword.Pseudo */ |
| 38 | + .kr, /* Keyword.Reserved */ |
| 39 | + .kt, /* Keyword.Type */ |
| 40 | + .no /* Name.Constant */ |
| 41 | + { |
| 42 | + color: var(--bh-code-keyword); |
| 43 | + } |
| 44 | + |
| 45 | + .l, /* Literal */ |
| 46 | + .il, /* Literal.Number.Integer.Long */ |
| 47 | + .m, /* Literal.Number */ |
| 48 | + .mf, /* Literal.Number.Float */ |
| 49 | + .mh, /* Literal.Number.Hex */ |
| 50 | + .mi, /* Literal.Number.Integer */ |
| 51 | + .mo, /* Literal.Number.Oct */ |
| 52 | + .se /* Literal.String.Escape */ |
| 53 | + { |
| 54 | + color: var(--bh-code-literal); |
| 55 | + } |
| 56 | + |
| 57 | + .n, /* Name */ |
| 58 | + .p, /* Punctuation */ |
| 59 | + .nb, /* Name.Builtin */ |
| 60 | + .ni, /* Name.Entity */ |
| 61 | + .nl, /* Name.Label */ |
| 62 | + .nn, /* Name.Namespace */ |
| 63 | + .py, /* Name.Property */ |
| 64 | + .w, /* Text.Whitespace */ |
| 65 | + .bp, /* Name.Builtin.Pseudo */ |
| 66 | + .vc, /* Name.Variable.Class */ |
| 67 | + .vg, /* Name.Variable.Global */ |
| 68 | + .vi /* Name.Variable.Instance */ |
| 69 | + { |
| 70 | + color: var(--bh-code-text); |
| 71 | + } |
| 72 | + |
| 73 | + .nv /* Name.Variable */ |
| 74 | + { |
| 75 | + color: var(--bh-code-var); |
| 76 | + } |
| 77 | + |
| 78 | + |
| 79 | + .o, /* Operator */ |
| 80 | + .kn, /* Keyword.Namespace */ |
| 81 | + .ow, /* Operator.Word */ |
| 82 | + .nt /* Name.Tag */ |
| 83 | + { |
| 84 | + color: var(--bh-code-operator); |
| 85 | + } |
| 86 | + |
| 87 | + .ld, /* Literal.Date */ |
| 88 | + .s, /* Literal.String */ |
| 89 | + .sb, /* Literal.String.Backtick */ |
| 90 | + .sc, /* Literal.String.Char */ |
| 91 | + .sd, /* Literal.String.Doc */ |
| 92 | + .s2, /* Literal.String.Double */ |
| 93 | + .sh, /* Literal.String.Heredoc */ |
| 94 | + .si, /* Literal.String.Interpol */ |
| 95 | + .sx, /* Literal.String.Other */ |
| 96 | + .sr, /* Literal.String.Regex */ |
| 97 | + .s1, /* Literal.String.Single */ |
| 98 | + .ss /* Literal.String.Symbol */ |
| 99 | + { |
| 100 | + color: var(--bh-code-string); |
| 101 | + } |
| 102 | + |
| 103 | + .na, /* Name.Attribute */ |
| 104 | + .nc, /* Name.Class */ |
| 105 | + .nd, /* Name.Decorator */ |
| 106 | + .ne, /* Name.Exception */ |
| 107 | + .nf, /* Name.Function */ |
| 108 | + .nx /* Name.Other */ |
| 109 | + { |
| 110 | + color: var(--bh-code-name); |
| 111 | + } |
| 112 | +} |
| 113 | + |
| 114 | +/* |
| 115 | + * Customise colours for Gherkin - the wagtail/pygments defaults don't feel quite logical |
| 116 | + */ |
| 117 | +.highlight-gherkin { |
| 118 | + /* Pygment "Function Name* in gherkin is the step feature / step text etc which is more like "text" in other langs */ |
| 119 | + --bh-code-name: var(--bh-code-text); |
| 120 | + /* Pygment "Variables" in gherkin is things like <placeholder> which are closer to step args */ |
| 121 | + --bh-code-var: var(--bh-code-string); |
| 122 | +} |
0 commit comments