I just need to adjust the height css for the header. I made a "custom.css" file and added my changes but it doesn't take effect.

Comments

fehin created an issue. See original summary.

mermentau’s picture

The best way is to use a sub-theme. I have some documentation on that here.

fehin’s picture

I have to subtheme just to add two lines of css? That's a lot.

mermentau’s picture

Either that or learn how .css files are added in Drupal 8 and then make that adjustment every time the theme is updated.

Akshay kashyap’s picture

Hello @fehin In Drupal 8, you need to define a "library" to add your custom CSS/JS.
The general steps for loading assets (CSS/JS) are:
1.Save the CSS or JS to a file.
2.Define a "library", which can contain both CSS and JS files.
You Need to create a separate *.libraries.yml and declare it in your theme's *.info.yml file.
If your theme is named "smart", then the file name should be smart.libraries.yml

Attaching to all pages:

To attach a library to all the pages on the site that use your theme, declare it in your theme's *.info.yml file.

name: smart
type: theme
core: 8.x
libraries:
- smart/cuddly-slider

Defining a library

cuddly-slider:
version: 1.x
css:
theme:
css/cuddly-slider.css: {}
Here is a link you can check https://www.drupal.org/docs/8/theming-drupal-8/adding-stylesheets-css-an...

Akshay kashyap’s picture

Status: Active » Needs review
meghasharma’s picture

Assigned: Unassigned » meghasharma
meghasharma’s picture

Assigned: meghasharma » Unassigned
Status: Needs review » Reviewed & tested by the community

This comment resolves the issue . Looks good to me .