ResourceSpace plugins
ResourceSpace 11 plugin

Custom CSS

Theme the whole of ResourceSpace in the browser – with live preview, version history and a light / dark mode switch for users.

Custom CSS manages the look of ResourceSpace. A theme is a set of CSS files loaded on every page of the site, including the login page. Edit it in the browser, preview the result before saving, go back to any earlier version and let users switch between light and dark mode.

Features

Themes as CSS folders

A theme is a folder with main.css, light-mode.css, dark-mode.css and any extra CSS files. One theme is active; files load in a fixed order, so the mode file always wins.

Editor with live preview

Syntax highlighting, file tabs, undo / redo, a syntax check as you type and a live preview of a page of the site – in light or dark mode – before anything is saved.

Version history

Every save creates a new version (up to 30 per theme). Load an old version into the editor, restore it or delete it.

Configurator

Colours, sizes and texts of a theme as a form instead of code – the theme variables, compared with the original theme.

Original theme custom-blue

A complete light and dark theme to start from. Create new themes from a blank set or a template, duplicate them, or move them between sites as .zip files.

Light / dark mode switch

A button for users: stored in the user's ResourceSpace preference, and in a browser cookie for guests and on the login page.

Login page styling

Ready-made settings for the SSO button and its texts, hiding the local account login and the height of the home page banner.

Safe by design

Theme files live in the filestore, outside the plugin folder – plugin updates never overwrite your themes. Everything is local, no external fonts or libraries.

Installation

In ResourceSpace

  1. Download the .zip above.
  2. In ResourceSpace open Plugin Manager > Upload a plugin and upload the file.
  3. Activate Custom CSS in the list of installed plugins, then open its Options.

Updating: upload the new .zip and choose Overwrite. Settings and data are kept in the filestore, outside the plugin folder.

On the server (command line)

# download and unpack – <RS_ROOT> is your ResourceSpace folder
cd /tmp
curl -fLO https://github.com/s29829/custom-css/releases/download/v1.35/customcss-1.35.zip
# only when updating – the plugin data stays in the filestore
sudo rm -rf <RS_ROOT>/plugins/customcss
sudo unzip -q customcss-1.35.zip -d <RS_ROOT>/plugins/
sudo chown -R www-data:www-data <RS_ROOT>/plugins/customcss

www-data is the user that runs PHP (Apache on the RHEL family: apache). Then activate the plugin in System > Plugins. With git: git clone https://github.com/s29829/custom-css <RS_ROOT>/plugins/customcss

Requirements

  • ResourceSpace 11
  • Optional: the PHP zip extension for downloading and uploading themes as .zip