17
Awlex
3y

Fucking css, why won't you work the same way you did locally when put in production

Comments
  • 4
  • 2
    You need better test content?
    Caching made not all changes deployed?
  • 3
    Have you applied CSS reset technique?
  • 2
    It does work the same. But...

    It might not have been deployed.
    It might not have been compiled (if you use one of the CSS compositing languages).
    It might not have replaced the old version in server/proxy/browser caches.
    ...

    Step 1: Check in browser dev console, whether the browser-visible CSS actually is the (compiled) CSS you have locally on your dev machine.
  • 1
    Jahy!
  • 1
    Top guesses:

    a) Your build-steps that combine-and-minify-css are re-ordering some selectors and the selectors ending up last in your css-file ends up overwriting earlier rules. Or maybe there's some 'smartness' that removes styles not found in your HTML and it's removing some selectors for elements that you add with JS.

    c) People are testing prod on a device with a different userAgent stylesheet.
  • 2
    @jiraTicket where is B?!
  • 1
    @iiii Omitting the second point on a list is a great little trick to make people pay attention :D (no, just kidding, I ended up making a mistake and passed the 5 minute edit deadline. Originally A was split into 2 items )
  • 0
    @darkwind Yeah :(

    @jiraTicket I just built the css locally and it looks excatly the same :(

    My sanity is droping. I got the css to work, but now the most important part of my app just returns a 404
  • 0
    @Awlex "I got the css to work" - What was the issue? (Not knowing what the issue was is worse than fixing an issue by accident imo. As it might return later)
  • 0
    @jiraTicket I have no idea, in my desperation I tore down the whole environment and rebuilt it. (Note: this is a hobby project and I don't have any users yet)
  • 1
    @Awlex Aight no harm done. Let's blame it on cache. 😁
  • 0
    I wish, but cache wouldn't destroy existing, unchanged layouts
Add Comment