user10155336
user10155336

Reputation: 33

Browser can not longer see saved CSS

So I was working on a page for the last week, every time when I end my job I save my files and close VSCode. Today I came back, opened everything and started writing. After a while I noticed that my rules in CSS did not came up in the page. I thought I did something wrong, so I tried different methods but nothing worked. Then I just opened the CSS in browser with F12 to check if something is off and I saw that it had the last weeks saved CSS. I closed everything, tried again, but nothing. The file is saved in local, I can see when it was changed, but browser still gets to see the last week's save. The link in HTML is right, never changed, the files are in correct folders, all is good. I'm working with WordPress and Twig atm, if this can help somehow.

<link rel="stylesheet" href="{{site.theme.link}}/style.css" type="text/css" media="screen" />

That's the link I used til now, it worked perfectly, paths never changed.

I'm sorry that I can't provide anything more but I can't really know what to show, like I changed nothing and it just stop working.

Thank you in advance for the time you'll take to help!

Upvotes: 3

Views: 95

Answers (2)

Nick
Nick

Reputation: 1269

Could it be a caching issue?

Try opening dev tools and then right clicking the refresh button.
It will give you an option to clear cache and hard refresh.
(Assuming your using chrome)

If that's the issue and you don't want to deal with it again, then you could consider appending a cachebuster to your css url.

The easiest way to do that would be something like {{site.theme.link}}/styles.css?r={{ random(1, 1000) }}

Keep in mind that in production, that's going to slow down delivery though (just a little bit, css files usually aren't that large) because it's going to invalidate the browser cache each time the site loads.

Upvotes: 0

gpl
gpl

Reputation: 1470

I suggest you to reinstall Mozilla Firefox. Follow these steps:

  • Backup your bookmarks (if you have any).
  • Take a screenshot of Add-ons page. It will help you to find and reinstall them.
  • Uninstall Firefox.

After uninstalling Firefox remove these folders:

C:\Users\[your-user-name]\AppData\Local\Mozilla

C:\Users\[your-user-name]\AppData\LocalLow\Mozilla and

C:\Users\[your-user-name]\AppData\Roaming\Mozilla.

If you have installed add-ons before uninstalling try this option:

Menu -> Help -> Restart with Add-ons Disabled

Upvotes: 1

Related Questions