Trying to customize this theme called Emon, but any theme styles I write bootstrap.css/template.css takes precedence even if we use identical selectors. I don't want to edit bootstrap.css/theme.css obviously, or use !important all over the place.

The theme offers a "Write your own CSS" section which has it at an inline-level, but it's not the easiest to maintain this way (though it's looking more attractive every minute). I saw libraries-override/extend, but wasn't able to accomplish what I want like this.

Again, I'm looking to tell Drupal to honor my stylesheet over the others without removing them. What is the right way to accomplish this?

  • Where you write the css? In module or in theme? – Jimmy Ko Jul 1 '16 at 23:39
  • 1
    As you can see here whatever is last is what gets applied. So it seems that styles.css is getting loaded before boostrap.css. Check your theme.info file to see if styles is before boostrap, if so all you have to do is switch places. – No Sssweat Jul 1 '16 at 23:53
  • Originally it was in the bottom of the 'global-components:' CSS section I tried moving it to the top, no change. I moved the stylesheet into it's own library and called it after 'global-components' in theme.info.yml still no change. – Jon Carlyon Jul 2 '16 at 1:14
  • @JonCarlyon did you flush the cache? – No Sssweat Jul 3 '16 at 8:52

Copy html.tpl file from your core module and place it in your themes folder ,look at the head element of your template then copy the path(link) of your CSS file and place it (at the last)after the themes CSS into the head tag.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.