jekyll-theme-yat icon indicating copy to clipboard operation
jekyll-theme-yat copied to clipboard

Is there a way to override CSS without unpacking the gem?

Open dogweather opened this issue 3 years ago • 4 comments

I'd like to override just the font size. In development, I'm trying this in assets/main.scss:

---
---
@import "{{ site.theme }}";

body {
    font-size: 16px;
}

But I get the error:

Error: File to import not found or unreadable: jekyll-theme-yat. (SassC::SyntaxError)

dogweather avatar Aug 30 '22 03:08 dogweather

Ah hah — I'm able to get an override by;

  1. Importing yat.
  2. Copying and pasting the theme's main.scss content into mine, and then adding my overrides there.

That's not a lot of duplication - just the one main.scss file. Is this the best way, do you think?

dogweather avatar Aug 30 '22 04:08 dogweather

Ah hah — I'm able to get an override by;

  1. Importing yat.
  2. Copying and pasting the theme's main.scss content into mine, and then adding my overrides there.

That's not a lot of duplication - just the one main.scss file. Is this the best way, do you think?

Hi @dogweather

You're right, that is the best way to do an override for you. : )

Thanks & Regards

jeffreytse avatar Aug 30 '22 06:08 jeffreytse

Thanks!

dogweather avatar Aug 30 '22 06:08 dogweather

If you want even less code duplication (at the expense of one extra web request), you can create a _includes/custom-head.html with a <link> to a custom stylesheet. For example,

  <link rel="stylesheet" href="{{ "/assets/css/custom.css" | relative_url }}">

And in assets/css/custom.scss,

---
---

<your custom Sass rules>

tchebb avatar Aug 24 '23 21:08 tchebb