Ad

Github Pages Style Error Without Changing Style.scss

- 1 answer

I've had a Github pages page running for several years, putting information into a table.

About a week ago I started getting build errors with the Style.scss file (which hasn't changed since Jan 2020). Putting it into a scss linter I got the following error:

Error: Invalid CSS after "": expected 1 selector or at-rule, was "---" on line 1 of stdin

The code below is used to colour headers and the page background, and create a gradient colour in the header. It also makes the table wider so more content can be seen on screen. Can anyone explain what this error means?

---
---

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

.page-header {
  background-color: #34657F;
  background-image: linear-gradient(#34657F, #34657F);
}

.main-content {
  background-color: #333f48;
  text-align:center;
  max-width: 100%;

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: #ffffff;
  }

  table {
    th {
      color: #ffffff;
    }
    th,
    td {
      color: #ffffff;
    }
  }
}

Edit:

Github page error

Your SCSS file assets/css/style.scss has an error on line 1: File to import not found or unreadable: cayman. Load path: /tmp/jekyll-remote-theme-20210727-6-1xrrbu1/_sass.

Ad

Answer

Turns out this is an issue with Github Pages.

https://github.com/pages-themes/cayman/issues/130#issuecomment-886056882

The way site themes are accessed was changed, causing @import "{{ site.theme }}"; to break.

Switching to directly refrencing your theme (in my case cayman) appears to fix it.

@import 'jekyll-theme-cayman';

Ad
source: stackoverflow.com
Ad