I'm working on a sub-theme of Bootstrap Barrio, which includes a table.css stylesheet. I don't want this stylesheet from the parent theme to be included in my sub-theme.

How do I eliminate a CSS file from sub-theme's parent?

  • On a closer read, the title of the question didn't reflect the body of the question, which did actually ask how to remove the parent css file, so yes, thanks @leymannx. I just edited the title of the other question to correct the discrepancy and hopefully help others find the question. – glenviewjeff Jun 9 '20 at 2:31

You can override it by adding a blank file with the same name in your theme (or you can add your own contents). Or, you can remove it altogether with libraries exclude: https://www.drupal.org/docs/theming-drupal/adding-stylesheets-css-and-javascript-js-to-a-drupal-theme#override-extend

  • Thanks, tried this but I must be doing something wrong. Please see this question. – glenviewjeff Jun 9 '20 at 16:44
  • 1
    Well, this is the answer to the current question that you asked. Why your implementation is not working is a new question (which you've correctly asked in a new thread). I don't have an answer to that one. – Jaypan Jun 9 '20 at 18:23
  • @Jaypan how would you override a contrib CSS file in your theme AND transform this CSS into a SCSS? What I am doing is the combination of overriding via blank .css file and then adding a SCSS component with the contrib CSS code in my theme and tune it to fit my needs using my variables, etc, but maybe there's a better approach. – jbarrio May 13 at 8:33
  • I'm not the right person to ask, and that's probably a question that deserves a new thread as it's not really the same as the original question. – Jaypan May 17 at 22:50

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