Is it safe to edit minified code for simple changes?

I am looking to make some simple changes to heading and section padding but the code is minified, and the developer has added this warning into much of the code sections:

“This is an autogenerated, minified file. It is referenced by the theme by default.
If you would like to edit this code we recommend swapping to the un-minified version”

Is this as big of an issue as it sounds? I cannot find anything about editing minified code.

hello @Michele113

You can add your CSS code in ‘layout > theme.liquid’ above tag like below example within tags.

.heading {

padding: 10px 0 ;

}

Hi @Michele113 ,

Are you accessing a CSS or JS file?

With CSS, you can add it at the bottom of the file or add the code directly in the theme.liquid file, it works fine.

With JS ,you need to change it to un-minified version because with minified file it will be very difficult for you to check or add code. You can find for filename at theme.liquid and then remove ‘.min’.

Hope it helps!

The theme.liquid is minified, "theme.min.css. So I am concerned about adding it in there. Is there a custom.css solution?

Hi @Michele113 ,

You can follow these steps:

  • Step 1: Go to Assets > Add a new asset.

  • Step 2: Go to layout > theme.liquid file and add code:

Code:

{{ 'custom.css' | asset_url | stylesheet_tag }}

Hope it helps!