Currently, a font.css file is added even when the user didn't make any CSS declarations via the interface. This results in a css file with content like this:

<none> { font-family: Ubuntu; font-style: normal; font-weight: 500; }

Comments

sreynen’s picture

Assigned: Unassigned » sreynen

I'll work on fixing this.

sreynen’s picture

Status: Active » Fixed

That was quicker than I thought. Fix committed to dev.

BarisW’s picture

Cool. I didn't test it, but doesn't this just create an empty CSS file? Or is there a check to see if there is content before the CSS file is created? Saves another server request where it's not needed ;)

sreynen’s picture

There's already a check to prevent loading an empty file, so the file shouldn't get loaded. It is wasting a file write on a file that won't be used, but I think that's probably better to address in #1165658: Only re-write font.css when CSS changes

sreynen’s picture

On second thought, once we change it so font.css isn't being re-written on every page load, it will be important to still write the empty file as an indication that it shouldn't be loaded.

BarisW’s picture

Yep, you are right. The font.css is not loaded anymore so that works. While testing I found out that the reference to the font itself (the Google link) is not added when the CSS selector is set to --None--. Not sure if this is right, it might cause some confusion. If a font is enabled, it should be loaded, independent of how it is called in the theme right?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.