Skip to content
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

[building] Syntax for corner items #11

Open
vvoovv opened this issue May 30, 2022 · 3 comments
Open

[building] Syntax for corner items #11

vvoovv opened this issue May 30, 2022 · 3 comments

Comments

@vvoovv
Copy link
Member

vvoovv commented May 30, 2022

A proposal.

image
Photo by Pauline Eccles, CC-BY-SA 2.0

Suppose a corner item has a level item as a neighbor from the right.

For the level we would have then:

level {
    // if corner items are to be inserted from both sides of the level item
    cornerClass: my_corner_class;
    ....
}

or

level {
    // if a corner item is to be inserted from the left side of the level item
    cornerClassLeft: my_corner_class;
    ....
}

or

level {
    // if a corner item is to be inserted from the right side of the level item
    cornerClassRight: my_corner_class;
    ....
}
@vvoovv
Copy link
Member Author

vvoovv commented Jul 1, 2022

The neighbor item that shares the corner with the level from the above example must also have the attribute cornerClass or cornerClassRight with the same value as in the level from the above example.

@vvoovv
Copy link
Member Author

vvoovv commented Jul 3, 2022

The proposal above isn't consistent.

It leads to incorrect width of items and complexities in calculating the item widths.

Consider the following setup:

level {
    markup: [
        div{
            cornerClassLeft: my_corner;
        }
        entrance{class: my_entrance;}
        div{}
        entrance{class: my_entrance;}
        div{
            cornerClassRight: my_corner;
        }
    ]
}

Div elements in a markup without any child items have the same width by design. When the size of the corner will be subtracted from the leftmost and rightmost div items, the resulting width of the leftmost and rightmost div items will be smaller than the width of the middle div.

@vvoovv
Copy link
Member Author

vvoovv commented Jul 4, 2022

The next iteration of the proposal. Corner element must be defined explicitly through the item corner:

level {
    markup: [
        corner{
            class: my_corner;
        }
        entrance{class: my_entrance;}
        div{}
        entrance{class: my_entrance;}
        corner{
            class: my_corner;
        }
    ]
}

The adjacent items on the adjacent facades must be of the type corner with the same class as their neighbors. A corner class can be omitted. In the latter case the attribute cornerClass from a parent item will be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant