Pass parameters from components to styles on said components

I have a view containing 5 containers. All of the containers are practically identical: they're programmed to be functionally identical to accordions, with the main caveat being that when they are clicked, the dropdown process is animated. My problem is that CSS forbids the 'auto' keyword from being used to define the dimension properties of a component size transition: in English, when animating a size change in a component, like width or height, the dimension has to be a static amount like '45px' and cannot be 'auto.'

My intended solution to this problem is to give each container a variable representing the intended pixel height of the dropdown that renders when each container is clicked. When the page is rendered, all of the containers would inherit the CSS style class, but each container would have its own unique definition of what it's 'height' should be when expanded that is passed into its own version of the style class.

Is there a way to implement a solution like this for Ignition Perspective components?