Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overriding CSS on github pages using slate theme?

I am trying to override the "forkme" banner on my github.io page to get a better understanding of how Jekyll, HTML, CSSand GitHub works.

For that purpose, I created my ./assets/css/style.css file as mentioned in the readme of the official documentation on how to customize the CSS of the officially supported GitHub themes. I added the following CSS to it:

#forkme_banner { display: none; }

However, no luck, the banner doesn't disappear. Even adding fictitious elements to the CSS file like #test {testing: testtest;} doesn't add the line to my CSS file.

like image 849
J. Doe Avatar asked Dec 21 '16 03:12

J. Doe


2 Answers

rename assets/css/style.css to style.scss and change your scss code to :

---
---
@import "{{ site.theme }}";
#footer_wrap {display: none;}
#forkme_banner {display: none;}
#downloads {display: none;}
#whocares {haha: hehe;}
like image 183
David Jacquel Avatar answered Oct 05 '22 07:10

David Jacquel


First and foremost thing is that the CSS changes takes time to update because it will be cached at their servers. It usually takes 15-45 minutes for me but for few, it is taking 3 hours. I think it depends on the server location that Github pages are hosed if I am not wrong.

Coming to issue

`./assets/css/style.css

 // change to 

./assets/css/style.scss`

it should be changed to .scss.

Another troubleshoot that I encountered is

---
---
@import "{{ site.theme }}";
/* "{{ site.theme }}" = Your theme name */
/* Eg: @import 'jekyll-theme-cayman'; */

/* Your css rules goes after this */
.page-header {
    background: #191c20;
}
like image 22
Harish V Avatar answered Oct 05 '22 09:10

Harish V