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

st-col does not seem to work properly #268

Open
montyvesselinov opened this issue Mar 15, 2024 · 6 comments
Open

st-col does not seem to work properly #268

montyvesselinov opened this issue Mar 15, 2024 · 6 comments

Comments

@montyvesselinov
Copy link

import Stipple
import StippleUI

@Stipple.vars Name begin
	name::String = "World!"
end

function ui()
	[
		Stipple.row([
			Stipple.cell(class="st-module", xs=5, sm=4, md=3, lg=2, xl=1,
				Stipple.p("Hello, World long long long long long long long long long long long long long long long long long long long long long long long!")
			),
			Stipple.cell(class="st-module", xs=7, sm=8, md=9, lg=10, xl=11,
				Stipple.p("Hello, World long long long long long long long long long long long long long long long long long long long long long long long!")
			)
		])
		Stipple.row([
			Stipple.cell(class="st-module", xs=5, sm=4, md=3, lg=2, xl=1,
				Stipple.p("Hello, World long long long long long long long long long long long long long long long long long long long long long long long!")
			),
			Stipple.cell(class="st-module", xs=6, sm=7, md=8, lg=9, xl=10,
				Stipple.p("Hello, World long long long long long long long long long long long long long long long long long long long long long long long!")
			)
		])
	]
end

Stipple.route("/") do
	Stipple.page(Stipple.init(Name), ui()) |> Stipple.html
end

Stipple.up()

The second row works ok because the sizes add up to 11. The 2 cells are always on the same row.

The top row breaks always break into 2 rows.

@hhaensel
Copy link
Member

You're right, "st-col" breaks the correct alignment. If you replace Stipple.cell with Stipple.htmldiv everything works as expected.
The problem is the additional margin, which should be corrected by stipplecore.css, but it seems it's overwritten by the the col classes.
We already had one issue with st-col breaking the quasar layout #247, which is still open.

@essenciary I propose to separate st-col elements and col elements. The quasar way of managing spacing would be to apply q-gutter classes, however it is important to know that you need a wrapper cell in almost all cases because margins and paddings are set by the gutter class.
We could add a keyword gutter = x with x in ["sm", "md", "lg", ..]. that adds the respective gutter class.

For closing the two issues, I see three possibilities:

  1. leave cell() as is and add qcell() (Quasar cell) or col() or similar to create a cell without automatic class 'st-col'
  2. rename cell() to stcell or similar and remove automatic class 'st-col' from current cell()
  3. remove automatic adding of st-col class completely

@hhaensel
Copy link
Member

@montyvesselinov What you want is probably best achieved by

function ui()
    [
        Stipple.row(class = "q-col-gutter-md", [
            Stipple.htmldiv(xs=5, sm=4, md=3, lg=2, xl=1,
                Stipple.cell(class = "st-module q-pa-sm full-height", "Hello, World long long long long long long long long long long long long long long long long long long long long long long long!")
            ), 

            Stipple.htmldiv(xs=7, sm=8, md=9, lg=10, xl=11,
                Stipple.cell(class = "st-module q-pa-sm full-height", "Hello, World long long long long long long long long long long long long long long long long long long long long long long long!")
            )
        ])

        Stipple.row(class = "q-col-gutter-md", [
            Stipple.htmldiv(xs=5, sm=4, md=3, lg=2, xl=1,
                Stipple.cell(class = "st-module q-pa-sm full-height", "Hello, World long long long long long long long long long long long long long long long long long long long long long long long!")
            ),

            Stipple.htmldiv(xs=6, sm=7, md=8, lg=9, xl=10,
                Stipple.cell(class = "st-module q-pa-sm full-height", "Hello, World long long long long long long long long long long long long long long long long long long long long long long long!")
            )
        ])
    ]
end

image

@montyvesselinov
Copy link
Author

Thank you! This is very helpful!

@hhaensel
Copy link
Member

Let's not close it yet, we're working on a fix.
Thanks for the feedback.

@hhaensel hhaensel reopened this Mar 17, 2024
@hhaensel hhaensel reopened this Mar 18, 2024
@hhaensel
Copy link
Member

@essenciary
When you move to GB with Vue-3 support, should we have a look at this issue before you release?

@essenciary
Copy link
Member

essenciary commented Oct 11, 2024

We have an (internal) task to revamp the UI and fix the grid system issues. @protozoo will tackle this soon. It will be before migrating to vue3 (and we'd have port these too).

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

3 participants