Configuring a Nextcloud Theme

nextcloudIn this article we will create a new theme, by starting with the default theme, so that any changes you make will not be overwritten in any future upgrade.  Also you can revert back to the default theme at any time.


Icon Colours

The Nextcloud icons have their colours based on the default theme colour.  Please select this colour before creating a new theme.

  1. Log in to Nextcloud with your admin account.
  2. Go to 'Your Avatar' > Settings.
  3. Click the Theming link in the left pane.
  4. Choose your main Color.

You could also upload your Logo (set size by editing the styles.css file) and Log in image (1920 x 1080).

The rest of this article describes the process of creating your own theme.  Note that settings made here will override settings in your custom theme, so it's good practice to make any changes here first (note: don't upload a logo, if you want to use different logos for the log in screen, and the main screen top-right).

 

Copy and Backup

Start by accessing the host, and browsing to the root directory of your installation.

Copy the example theme and rename the folder to something like 'mytheme'.

cd /nextcloud/themes
cp -r example mytheme

Open the /config/config.php file and add the following line to activate your new theme.

'theme' => 'mytheme',

Now you can edit your newly created theme, without affecting the Nextcloud installation.

 

Image files

You might start by replacing some of the logos with your own images, in the /mytheme/core/img directory:

  • favicon.ico:  Standard favicon.
  • favicon-touch.png:  Browser logo when using mobile devices.
  • logo.svg:  Centre logo, before you log in
  • logo-icon.svg:  Logo top-left after you've logged in.

 

CSS files

Editing the CSS file allows you to change the colours.  Open the /mytheme/core/css/styles.css file and edit the following lines:

  • Line 25 for the main brand colour.
  • Lines 32 to 39 for the background gradient.
  • Lines 54, 55 and 67 for the button colours.

 

Text

Finally you will want to change the text on the login screen.  Open the /mytheme/defaults.php file and edit the following lines:

  • Line 28: Add your URL http://yourwebsite.com
  • Lines 76, 84, 92 and 100: Enter your School Name.
  • Line 108: Add your own slogan.
  • Line 151: Set your main brand colour.

 

Thanks for visiting.