Jfer00 Posted May 27, 2020 Share Posted May 27, 2020 Hi, I have a custom html list whose items I try to show in three columns with flexbox. List items have padding to add room for item background. li { flex: 0 0 calc(33% - 66px); padding: 0 16px 0 50px; background: url('check.png') no-repeat left top; } The problem is that squarespace has some kind of preprocessor which converts calc() to this: (style copied from browsers inspector) flex: 0 0 calc(-33%); How should I write calc() to keep it in the desired format? Link to comment
tuanphan Posted May 27, 2020 Share Posted May 27, 2020 You can add CSS to Code Injection Header or add to Code Block, I think it will work there. <style> paste css here </style> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Jfer00 Posted May 29, 2020 Author Share Posted May 29, 2020 Thanks tuanphan, it works as there is no preprocessor for code blocks. 🙂 I just would prefer to put all custom code to the same place but if it's not possible I just have to use code blocks. Link to comment
Solution paul2009 Posted May 29, 2020 Solution Share Posted May 29, 2020 @Jfer00 This is because the 'Custom CSS' panel is actually the 'Custom LESS' panel 😁. Any math operations in brackets are calculated first (33-66=-33) and then the CSS parsed. You can avoid this by using escaping it like this: flex: 0 0 calc(~"33% - 66px"); DV2, Spark_plugin and Desigra 1 2 About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. Content: Links in my posts may refer to SF Digital products or may be affiliate links. Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.Improve your online store with our extensions. Link to comment
Desigra Posted May 29, 2021 Share Posted May 29, 2021 @paul2009 Works perfectly. 👌 Thank you so much! 🙌 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment