codyhouse / codyhouse-framework

A lightweight front-end framework for building accessible, bespoke interfaces.
https://codyhouse.co/
MIT License
1.16k stars 173 forks source link

Issues with aspect-ratio #79

Closed oppenheimer- closed 3 years ago

oppenheimer- commented 3 years ago

Starting in Line 62 as of writing.

1) The selector [class*="aspect-ratio"] is a bit too greedy imho, because it "hijacks" classes in my wordpress setup which unfortunately generates aspect-ratio classes in wp-embed as well. I vote for changing this into a a simple class of just ".aspect-ratio".

2) In my stack the values for --aspect-ratio dont get converted into floats and therefore produce an insufficient padding rendering components invisible. Replacing "16/9" with "calc(16/9)" did the trick for me.

sebastiano-guerriero commented 3 years ago

good point. We'll def look into this 👍

sebastiano-guerriero commented 3 years ago

In v2.8.7 we're using a different selector: now we target only the classes that start with 'aspect-ratio'. If you create other classes in WP (e.g., wp-aspect-ratio...), they won't be affected by CodyFrame's util classes.

https://github.com/CodyHouse/codyhouse-framework/releases/tag/v2.8.7

About point 2: I couldn't recreate the bug. There's already a calc() in the padding-bottom property.

sebastiano-guerriero commented 3 years ago

Now I see why it's preferred to have a calc() in the variable definition.

We've fixed this issue in v2.8.8: https://github.com/CodyHouse/codyhouse-framework/releases/tag/v2.8.8