[CWB] CSS
Hardie, Andrew
a.hardie at lancaster.ac.uk
Sat May 30 17:03:07 CEST 2026
It depends what tweaks you want to make.
If you just want to change the colour scheme, it’s pretty easy; create a CSS file that has the following in it:
:root {
--colour-layout-bg : $COLOUR;
--colour-layout-data2 : $COLOUR;
--colour-layout-outline : $COLOUR;
--colour-layout-fg : $COLOUR;
--colour-layout-strong : $COLOUR;
--colour-layout-contrast : $COLOUR;
--colour-text-normal : $COLOUR;
--colour-text-strong : $COLOUR;
--colour-text-bright : $COLOUR;
--colour-text-faint : $COLOUR;
--colour-tooltip-frame : $COLOUR;
--colour-tooltip-bg : $COLOUR;
--colour-tooltip-text : $COLOUR;
}
In the example above, $COLOUR means you can use any of the normal CSS ways of specifying a colour: #3399cc, black, red, etc.
Save your CSS file. Put it on the web – anywhere will do; not necessarily in the CQPweb server.
You then need to switch a given corpus over to the new colour scheme. Here’s how: go to the SQL client, and run this command as many times as necessary:
update corpus_info set colour_scheme = "$path" where corpus = "$handle";
… filling in $path and $handle as follows.
$path – either a full URL (w/ leading http or https) OR if you put it under CQPweb’s css folder, a path of this form: “../css/xxxxxxxxx.css”
$handle – lowercase handle of the corpus
To apply a bunch of custom colours to the three no-corpus UIs (admin, homepage, user acct page): create a CSS file with a :root {} as per above, but put the URL into the relevant config file values:
## Colour scheme to use for the main menu page (e.g. "~blue", "~red", etc.).
# $colour_scheme_for_homepage = "~blue";
## Colour scheme to use for the admin control panel page.
# $colour_scheme_for_adminpage = "~red";
## Colour scheme to use for the user-login homepage.
# $colour_scheme_for_userpage = "~green";
Replace “~blue/red/green” with the URL you want to use (or path to something under the “css” folder).
Changing more than just colours is more complex.
If you want to add special styling for S-attribute or P-attribute data in the interface, you need to use visualisations to make the relevant spans/divs show up in the UI, and then create custom CSS to render them how you want them to appear.
If you want to change stuff more fundamentally, e.g. table border widths, text size, etc. the only way to do it is to have a look at the main CSS file (which is css/0system.css) and create overrides to what you find there in your own CSS file, hooked into the system as per above (for specific corpora and/or the three other interfaces).
Note that all of the above is for v3.3. v3.2 was different. You could change stuff more easily, IIRC.
best
Andrew.
From: CWB <cwb-bounces at sslmit.unibo.it> On Behalf Of Graham Ranger -- UAPV via CWB
Sent: 27 May 2026 15:00
To: Open source development of the Corpus WorkBench <cwb at sslmit.unibo.it>
Cc: Graham Ranger -- UAPV <graham.ranger at univ-avignon.fr>
Subject: [CWB] CSS
Hello again,
The second question I mentioned concerns CSS files and themes for cqpweb. I'm pretty sure this has been asked before, so please point me in the right direction, if this is the case.
Is there a simple "how to", explaining how to tweak the appearance of the site? (I.e. which css files need modifying.)
And secondly, are there any kind souls who would like to share successful css files, possibly for further tweaking?
Many thanks again for your help.
Best,
Graham.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20260530/6805a83e/attachment-0001.html>
More information about the CWB
mailing list