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

Centering items when all items are in view. #98

Open
chillikid opened this issue Feb 26, 2021 · 2 comments
Open

Centering items when all items are in view. #98

chillikid opened this issue Feb 26, 2021 · 2 comments

Comments

@chillikid
Copy link

chillikid commented Feb 26, 2021

Thanks for the great script.

What I want to do is center the items on screen when all items are visible on screen. As a default they always start on the right .
I tried
.v-hl-container {
justify-content: center;
}

This works when all items on screen are visible, but then when all items cannot fit on screen it causes a problem in that elements expand both to the left and right out of the viewport and the initial view position is the center of the row.

Is there a simple CSS way to achieve this ? It would seem like a common user case.

Thanks

@chillikid
Copy link
Author

After an awful lot of messing about and trying different things, I got it to center on the screen when there are less items than the full width of the viewport by doing the following

<style> .v-hl-container { margin: 0 auto -30px !important; width: auto !important; } </style>

It would be nice if this could be an option in the CSS core as I'm not a fan of using !important to force override styles.

@mahammad-sixberries
Copy link

thanks @chillikid, I'd prefer

.v-hl-container {
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

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

2 participants