huanshankeji / compose-multiplatform-material

Unified Compose Multiplatform common extensions and Material wrappers for `androidx.compose` and Compose HTML
https://huanshankeji.github.io/compose-multiplatform-material/
Apache License 2.0
17 stars 0 forks source link

A common interface for `Modifier` and CSS styles instead of HTML attributes #1

Closed ShreckYe closed 7 months ago

ShreckYe commented 1 year ago

After working on this project for a while it seems to me that a Compose Modifier is more similar to the CSS styles in the style attribute instead of all the attributes of an HTML element, while HTML attributes are more similar to a Composable's arguments. If this is investigated to be true in most cases, modify the existing ModifierOrAttrs interface into a common interface for Modifier and CSS styles instead of HTML attributes.

ShreckYe commented 1 year ago

Some references:

  1. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
  2. https://www.w3schools.com/html/html_attributes.asp

It appears that the HTML attributes customizing styles, e.g., height, width, and bgcolor have become legacy.

ShreckYe commented 1 year ago

This requires furthur consideration as CSS styles can also be set through the class property.