Skip to content

Commit

Permalink
feat: add optional custom css
Browse files Browse the repository at this point in the history
  • Loading branch information
evolkmann committed Mar 25, 2021
1 parent 30dff30 commit 3f68dc1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Arena({
prefix: 'foo',
},
],

// Optionally include your own stylesheet
customCssPath: 'https://example.com/custom-arena-styles.css'
});
```

Expand Down Expand Up @@ -196,7 +199,10 @@ const arenaConfig = Arena({
basePath: '/arena',

// Let express handle the listening.
disableListen: true
disableListen: true,

// Optionally include your own stylesheet
customCssPath: 'https://example.com/custom-arena-styles.css'
});

// Make arena's resources (js/css deps) available at the base app route
Expand Down Expand Up @@ -237,7 +243,10 @@ const arenaConfig = Arena({
basePath: '/arena',

// Let express handle the listening.
disableListen: true
disableListen: true,

// Optionally include your own stylesheet
customCssPath: 'https://example.com/custom-arena-styles.css'
});

// Make arena's resources (js/css deps) available at the base app route
Expand Down
3 changes: 3 additions & 0 deletions example/bee.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ async function main() {
},
},
],

// Optionally include your own stylesheet
customCssPath: 'https://example.com/custom-arena-styles.css'
},
{
port: HTTP_SERVER_PORT,
Expand Down
3 changes: 3 additions & 0 deletions example/bull.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ async function main() {
},
},
],

// Optionally include your own stylesheet
customCssPath: 'https://example.com/custom-arena-styles.css'
},
{
port: HTTP_SERVER_PORT,
Expand Down
1 change: 1 addition & 0 deletions src/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = function (config) {
app.locals.Queues = queues;
app.locals.appBasePath = '';
app.locals.vendorPath = '/vendor';
app.locals.customCssPath = config.customCssPath;

app.set('views', `${__dirname}/views`);
app.set('view engine', 'hbs');
Expand Down
3 changes: 3 additions & 0 deletions src/server/views/layout.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

<link rel="stylesheet" href="{{ basePath }}{{ vendorPath }}/jsoneditor.min.css">
<link rel="stylesheet" href="{{ basePath }}{{ vendorPath }}/tablesort.css">
{{#if customCssPath}}
<link rel="stylesheet" href="{{ customCssPath }}">
{{/if}}
</head>

<body>
Expand Down

0 comments on commit 3f68dc1

Please sign in to comment.