Good afternoon all,

I am literally, completely new to Drupal 8 and theme development and I have set Drupal 8.3.3 up on WAMP (Windows 10) and have created the basic files and folders to start creating my own theme how ever when putting a simple bit of CSS into one of my style-sheet files it does not get linked and hence does not render on the Drupal site.

I have the following structure:

config
css
images
js
templates
wdrc.breakpoints.yml
wdrc.info.yml
wdrc.libraries.yml
wdrc.theme

Info file:

name: WDRC
type: theme
description: 'WDRC Master site theme'
core: 8.x
libraries:
  - wdrc/global-styling
base theme: stable
regions:
  header: Header
  content: Content
  sidebar_first: 'Sidebar first'
  footer: Footer

Libraries file:

global-styling:
  version: 1.0
  css:
    theme:
      css/base.css: {}
      css/layout.css: {}
      css/components.css: {}
      css/print.css: {media: print}
	  
js-header:
  header: true
  js:
    header.js: {}

js-footer:
  js:
    footer.js: {}

base.css:

html {
	 background-color: #ffef0f; }

I have tried clearing the cache from the Performance and optimisation controls to no avail; can anyone help with this?

Comments

fkelly12054@gmail.com’s picture

Have you put your theme in the /themes folder ... at the same level as /core? That's where user contributed themes need to go. If you have it right then you need to go to admin/appearance and install the theme and set it as default. I'd be careful to leave a core theme such as Bartik as the admin theme so you don't muck up your site entirely.

I'm not sure that creating an entire theme from scratch is the best strategy for someone new to this. You might want to look into creating a sub-theme of an existing working theme (there are articles on this, search) and just customizing the things you want to change. Even that can be a little tricky to get working.

LTGoldman’s picture

Good afternoon fkelly,

Yes I created a folder called 'wdrc' which is in the /themes folder, I am not sure what you mean at same level as core as it cannot be at same level as core if you place the wdrc theme into the /themes folder?

I have installed the theme, when setting the theme as default I got an error which prevented viewing any of the sites pages including administration pages. As this was just a very quick and basic set up I am not bothered that I am having to rebuild Drupal.

Working from scratch in my opinion is the only way to learn from the ground up; so I'll invest some more time on this. I will probably return back in the course of the next week or two as I work to get a very basic theme working.

fkelly12054@gmail.com’s picture

Your folder structure should be
/ (basically root ... or public_html on most shared web sites)
/core
/modules
/themes
/libraries

etc.
the /core folder will have a /modules and a /themes folder in it ... those are the modules and themes that are distributed as part of core

Go ahead and work from scratch if you want. Drupal is not for the faint of heart in terms of programming. The errors you are seeing are just the beginning I suspect. There is a whole API (application programming interface) that you need to learn as well as formats for YML and twig programming. That's why I'd recommend that you work with a sub-theme, customizing an existing theme that works properly to get started. It's also why I recommended leaving an existing theme such as Bartik as your admin theme so that the site will be accessible even if you foul something up in your experiments. Rebuilding from scratch gets old in a hurry.

Good luck.