AlaskaAirlines / auro-flightline

A custom element that represents the intermediate details between a departure and arrival station on a flight.
https://auro.alaskaair.com/components/auro/flightline
Apache License 2.0
0 stars 2 forks source link

Replace resize observer with CSS container queries #56

Closed blackfalcon closed 1 year ago

blackfalcon commented 1 year ago

Is your feature request related to a problem? Please describe.

The following code is part of a bootstrap solution to support container queries before CSS container queries were broadly available.

https://github.com/AlaskaAirlines/auro-flightline/blob/63ed29d5214f48ee8de092b2c5d088ab98f969ba/src/auro-flightline.js#L26-L42

The current issue is that the following tests are failing for unknown reasons.

https://github.com/AlaskaAirlines/auro-flightline/blob/63ed29d5214f48ee8de092b2c5d088ab98f969ba/test/auro-flightline.test.js#L57-L80

Describe the solution you'd like

Instead of updating code/tests it is preferred that we remove the bootstrap code and update the component to use CSS container queries that are easily supported by the browser. This solution will remove the maintenance and testing dependency related to supporting the bootstrap solution.

https://caniuse.com/css-container-queries

https://mxb.dev/blog/container-queries-web-components/

This will be a BREAKING CHANGE in regards to the cq attribute will no longer be supported. This work should be addressed with the current efforts to re-release the component under the @aurodesignsystem npm namespace.

Describe alternatives you've considered

Trying to fix the code/tests.

Exit criteria

This issue will be considered complete once the resize observer code has been removed from the project and the currently supported feature (see attached screenshot) is still supported without any changes needed by the consumers.

Screen Shot 2023-07-28 at 2 45 56 PM