AlaskaAirlines / auro-loader

A custom element for the purpose of illustrating animated loaders
https://auro.alaskaair.com/components/auro/loader
Apache License 2.0
0 stars 1 forks source link

feat: reflect properties to attributes #6

Closed geoffrich closed 3 years ago

geoffrich commented 3 years ago

Alaska Airlines Pull Request

This improves compatibility with Svelte and Preact by reflecting properties to attributes.

Summary:

Svelte and Preact favor setting properties instead of attributes for custom elements. Since this component relies on the presence of those attributes on the host element to set styles, the element did not display properly in those frameworks.

In the future, we should reflect properties that we want to use for styling to prevent these issues.

I also renamed the internal sm and md properties. This was causing a similar issue -- the frameworks thought these were equivalent to the sm and md attributes we were setting.

Type of change:

Please delete options that are not relevant.

Checklist:

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!
-- Auro Design System Team

geoffrich commented 3 years ago

The following now works in my Svelte project:

<auro-loader ringworm="true" md="true"></auro-loader>
<auro-loader ringworm="true"></auro-loader>
AuroDesignSystem commented 3 years ago

:tada: This PR is included in version 1.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: