Skip to content

Commit

Permalink
fix: custom css import
Browse files Browse the repository at this point in the history
  • Loading branch information
Myllaume committed Dec 13, 2024
1 parent 719320a commit 2478051
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 239 deletions.
3 changes: 0 additions & 3 deletions core/frontend/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import './styles.css';
import './print.css';

import './records.js';
import './search.js';
import './graph.js';
Expand Down
3 changes: 3 additions & 0 deletions core/models/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import frontendScript from 'front';
import GraphEngine from 'graphology';
import { extent } from 'd3';
import extractCitations from '../utils/citeExtractor.js';
import cssPrint from '../frontend/print.css';
import cssStyles from '../frontend/styles.css';

/**
* @typedef ThumbnailIntegration
Expand Down Expand Up @@ -332,6 +334,7 @@ class Template {
translation: langPck.i,
lang: lang,

css: cssStyles + cssPrint,
customCss: this.custom_css,

views: views || [],
Expand Down
2 changes: 1 addition & 1 deletion e2e/csv/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ record_types:
link_types:
undefined:
stroke: simple
color: "#e1e1e1"
color: "#a0a0a0"
proche:
stroke: double
color: "#000"
Expand Down
28 changes: 27 additions & 1 deletion e2e/csv/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
:root {
--background-gray: rgb(31, 31, 31);
}

body {
background-color: black;
}

aside.menu {
color: white;
}

main.record-container {
background-color: rgb(31, 31, 31);
color: white;
}

.title {
color: gray !important;
color: gray;
text-transform: unset;
}

.graph-controls {
color: white;
}

.graph-wrapper text {
fill: white;
}
228 changes: 0 additions & 228 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@
"@babel/preset-env": "^7.24.5",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.3",
"css-loader": "^7.1.2",
"cypress": "^13.9.0",
"jest": "^29.7.0",
"mocha": "^10.4.0",
"prettier": "3.2.5",
"style-loader": "^4.0.0",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"yaml-loader": "^0.8.1"
Expand Down
1 change: 1 addition & 0 deletions static/template/cosmoscope.njk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
--highlight: {{ graph.config.graph_highlight_color }};
}
{{ css | safe }}
{% if customCss %}
{{ customCss | safe }}
{% endif %}
Expand Down
4 changes: 4 additions & 0 deletions webpack-back.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export default {
test: /\.svg$/,
type: 'asset/source',
},
{
test: /\.css$/,
type: 'asset/source',
},
{
test: /\.png$/,
type: 'asset/inline',
Expand Down
4 changes: 0 additions & 4 deletions webpack-front.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ export default {
},
},
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
],
},
resolve: {
Expand Down

0 comments on commit 2478051

Please sign in to comment.