Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

CSS being removed from file on server

first-time

Started by Lukas Severinghaus 8 years ago · 5 replies · 726 views
8 years ago

I'm running this website with grav: northernazaerialphotography.com. I have a book today button in the bottom right of each page. I've tried to add additional styling to the button to invert the normal coloring scheme, so that the button is white text on blue background when not hovered over, and white background with blue text when hovering over it. I've tried to add this in my custom.css file in the antimatter theme by adding a float-right class, that I use to keep the button on the right side and I've also tried to use it to overwrite the default coloring for the button, namely implementing the color changes above. This is the contents of the custom.css file:
.fa-instagram, .fa-facebook {
font-size: 30px !important;
width: 50px;
}

.float-right {
float: right !important;
background: #1BB3E9;
color: #fff;

}

.float-right:hover {
color: #1BB3E9 !important;
background: #fff !important;
}

.test {
color: #fff;
}

I added the test class above just to see if this problem was not limited to just one class.

When I load the button on my page and inspect the css, I find that the float: right; CSS from the float-right class is included, but no other lines. Opening the css file in my browser shows that there are several lines missing:
The file here: http://www.northernazaerialphotography.com/user/themes/antimatter/css/custom.css
Has these contents:
.fa-instagram, .fa-facebook {
font-size: 30px !important;
width: 50px;
}

.float-right {
float: right !important;
}

This is only some of what I have in the custom.css file. I would assume this is because of the way that Grav optimizes the css, or something else, but is there a way for me to either a) include the css that is being left out, or b) change the coloring of the button without using the custom.css file?
Thanks,

8 years ago

I found out that the CSS was being removed by the minifier and by disabling css minification in the system.yaml file fixed the problem.

8 years ago

Are you using Windows? Please check your file line ending encodings and your file encoding. UTF-8 and LF should be the correct settings.

8 years ago

I'm using Ubuntu on Amazon hosting. As I mentioned before, the error was fixed by turning off CSS minification, so that leads me to believe that whatever process did the minification did not find it necessary to include the other lines of css. I'm fine with leaving minification off, I'm just curious as to why it removed those lines.
Thanks,

8 years ago

@kk6axq:
I’m using Ubuntu on Amazon hosting

I meant the system where you edit the CSS-File. ;-)

8 years ago

I'm editing the files through Nano in a SSH connection to the server, so the editing OS is Ubuntu.
Thanks,

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 198 2 months ago
Themes & Styling · by Ian, 2 months ago
3 94 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 455 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 48 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 128 3 months ago