It is a Custom CSS field that writes to a CSS file. I made that field untranslatable, but if anything is saved on the secondary language site.yml it erases everything in the css/site.css file.
I tried adding “if/else” kirby()->languages()->default but that doesn’t influence anything.
This condition is always true (because the code return the default language and doesn’t check if the current language is the default language), you need to check the current language
kirby()->language()
returns the current language. And with
kirby()->language()->isDefault()
you can check if the current language is the default language.
And then only write conditionally, because otherwise you write null to the file.