Skip to content

Reconsider disabled properties on containers #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ZeeCoder opened this issue Mar 15, 2017 · 5 comments
Closed

Reconsider disabled properties on containers #20

ZeeCoder opened this issue Mar 15, 2017 · 5 comments
Milestone

Comments

@ZeeCoder
Copy link
Owner

As an attempt to avoid circulatory issues, refuse to parse the CSS if it's trying to change the container's width or height.

  • Either via a container unit in the same rule where the container was defined,
  • Or inside a @container query, whether the value's unit is container unit or not.

Also look into disabling other properties, like padding, which again could affect the container's size.

@ZeeCoder
Copy link
Owner Author

It's probably not worth disabling all properties though, like the ability to change the background for instance is nice.
And also, just that wouldn't solve the circular issues anyway.

@ZeeCoder
Copy link
Owner Author

More food for thought: sometimes even setting width / height can be harmless.
For example - assuming a "Resize Sensor" of some sort - setting height to: 5cwpx would react to width size change -> where the height's change would trigger the sensor yet again, but this time nothing would change since width didn't change.
For this reason even prohibiting the usage of container units for width / height properties would be unnecessary.
It doesn't solve the problem it's meant to solve, but limits the developer.

@ZeeCoder
Copy link
Owner Author

Now however, using cw / ch for the property it relates to must be forbidden.
height: 110chpx would infinitely grow in height for example.

@ZeeCoder ZeeCoder changed the title Don't allow resizing container width/height Reconsider disabled properties on containers Mar 26, 2017
@ZeeCoder
Copy link
Owner Author

For now I think restrictions should be lifted, and only obvious cases - like the one above - should be checked, where circular issues would surely arise.

To "properly" address circular issues would be a bigger undertaking:

  • Try to detect issues on PostCSS parsing first,
  • Maybe a clever algorithm could be written which would detect issues runtime too.

@ZeeCoder
Copy link
Owner Author

Use-case: Setting font-size on a button component could result in weird behaviour, if the text can wrap.

  1. Font-size changes
  2. text grows big, and breaks to multiple lines
  3. The container gets bigger
  4. Which then sets the font size bigger again
    Then back to 1)

@ZeeCoder ZeeCoder added this to the 2.0.0 milestone May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant