Skip to content

Commit 2f5a822

Browse files
committed
move gist and codehitlite css to have their own entry point
1 parent 42c056e commit 2f5a822

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

tbx/project_styleguide/templates/patterns/molecules/streamfield/blocks/markdown_block.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
{% load wagtailmarkdown %}
1+
{% load wagtailmarkdown static %}
2+
23
<div class="grid__markdown markdown-block">
4+
<link rel="stylesheet" type="text/css" href="{% static 'css/codehilite.css' %}">
5+
36
{# tabindex needed because in order to scroll using the keyboard #}
47
<div class="markdown-block__scroller" tabindex="0">
58
{{ value|markdown }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
{% load static %}
2+
13
<div class="grid__raw-html">
4+
{% if 'gist' in value %}
5+
<link rel="stylesheet" type="text/css" href="{% static 'css/gist.css' %}">
6+
{% endif %}
7+
28
{{ value }}
39
</div>

tbx/static_src/sass/main.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,3 @@
8181
@tailwind base;
8282
@tailwind components;
8383
@tailwind utilities;
84-
85-
// CSS from external vendors (not available as npm)
86-
@import 'vendor/codehilite';
87-
@import 'vendor/gist';

tbx/static_src/sass/vendor/_codehilite.scss renamed to tbx/static_src/sass/vendor/codehilite.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// This file has it's own entry point in webpack and is only included in markdown_block.html
2+
13
/*!
24
Code highlighting generated from Pygments | https://pygments.org/
35
| Copyright 2006-2023 by the Pygments team
@@ -8,8 +10,6 @@
810

911
/* stylelint-disable */
1012

11-
@use 'config' as *;
12-
1313
.mode-dark {
1414
pre {
1515
line-height: 125%;

tbx/static_src/sass/vendor/_gist.scss renamed to tbx/static_src/sass/vendor/gist.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// This file has it's own entrypoint in webpack.js and is only included in raw_html_block.html
2+
13
/* stylelint-disable */
24

35
/*!

webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const options = {
1515
// here, it will deem the quotes uneccessary.
1616
'main': `./${projectRoot}/static_src/javascript/main.js`, // prettier-ignore
1717
'admin': `./${projectRoot}/static_src/javascript/admin.js`, // prettier-ignore
18+
'gist': `./${projectRoot}/static_src/sass/vendor/gist.scss`, // prettier-ignore
19+
'codehilite': `./${projectRoot}/static_src/sass/vendor/codehilite.scss`, // prettier-ignore
1820
},
1921
resolve: {
2022
extensions: ['.ts', '.tsx', '.js'],

0 commit comments

Comments
 (0)