lost icon indicating copy to clipboard operation
lost copied to clipboard

Docs on Nesting a bit Misleading

Open ryanfitzer opened this issue 7 years ago • 4 comments

I found this aspect of the docs misleading:

Nesting is simple. There is no context required.

I think I it would be more accurate if it read:

Nesting is simple, but context is not supported. Nested elements are relative to their direct parent’s dimensions.

This is an issue for elements that need to scale with the root grid, independent of the width of their direct parent.

The docs made me think that there was a way to make sure that a child with lost-column: 1/20 would represent the proper column width, relative to the root, even when nested inside of a lost-column: 16/20.

Just making sure I’m not missing some hidden context feature.

ryanfitzer avatar Oct 19 '18 14:10 ryanfitzer

Looking in the code, I see that it's possible to set a global variable for units @lost gridUnit vw; instead of having to use lost-unit: vw; everywhere. Setting this doesn't seem to work. Since it's not documented, I had no expectation of it working, but I'm curious as to the status of this setting. Any ideas?

ryanfitzer avatar Oct 23 '18 20:10 ryanfitzer

@ryanfitzer, let me look into this a bit. There might be a better option to do some sort of show and tell, here. I'm going to make a note to come back to this. If you want to make some direct suggestions to the docs in a PR I'd love to see that. I think at the very least your proposed wording change is something that could easily be slotted in.

peterramsing avatar Nov 08 '18 07:11 peterramsing

Looking in the code, I see that it's possible to set a global variable for units @lost gridUnit vw; instead of having to use lost-unit: vw; everywhere. Setting this doesn't seem to work. Since it's not documented, I had no expectation of it working, but I'm curious as to the status of this setting. Any ideas?

Working on this here: https://github.com/peterramsing/lost/pull/452

peterramsing avatar May 30 '22 19:05 peterramsing

I found this aspect of the docs misleading:

Nesting is simple. There is no context required.

I think I it would be more accurate if it read:

Nesting is simple, but context is not supported. Nested elements are relative to their direct parent’s dimensions.

This is an issue for elements that need to scale with the root grid, independent of the width of their direct parent.

The docs made me think that there was a way to make sure that a child with lost-column: 1/20 would represent the proper column width, relative to the root, even when nested inside of a lost-column: 16/20.

Just making sure I’m not missing some hidden context feature.

I made this change here to the docs: https://github.com/peterramsing/lost/pull/450

peterramsing avatar May 30 '22 19:05 peterramsing