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

[Feature Request] Add alignment options to v-timeline #6594

Closed
timoschwarzer opened this issue Feb 25, 2019 · 13 comments
Closed

[Feature Request] Add alignment options to v-timeline #6594

timoschwarzer opened this issue Feb 25, 2019 · 13 comments
Assignees
Labels
C: VTimeline VTimeline T: feature A new feature
Milestone

Comments

@timoschwarzer
Copy link
Contributor

timoschwarzer commented Feb 25, 2019

Problem to solve

With the current framework options there's (as far as I know) no way to alter the 50%/50% split between the content and the opposite slot.

See #6594 (comment)

Proposed solution

I think this needs to be discussed as I don't have a good idea for this.

@nekosaur
Copy link
Member

Your title says that dense timelines should display opposite slot, but reading the text it sounds like you simply want to align all items to one side or another. This is already possible. Use left or right prop in v-timeline-item

https://codepen.io/anon/pen/OqyBBB

@timoschwarzer
Copy link
Contributor Author

timoschwarzer commented Feb 28, 2019

Oh, thanks, you're right. I somehow missed these attributes.
Well, then I have to reword this issue. My intent is to resize the opposite slot to the minimum width. Currently it's fixed at 50% for the opposite slot and 50% for the actual content. I want all content on one side with the maximum width possible. 😅

Edit: Example:
image

I haven't found a way to accomplish this with the current framework options.

@timoschwarzer timoschwarzer changed the title [Feature Request] Dense timelines should display opposite slot [Feature Request] Add alignment options to v-timeline Feb 28, 2019
@MajesticPotatoe MajesticPotatoe added T: feature A new feature C: VTimeline VTimeline labels Apr 9, 2019
@nekosaur nekosaur added the pending review The issue is still pending disposition label Apr 10, 2019
@johnleider johnleider removed pending review The issue is still pending disposition labels Apr 25, 2019
@yashdhume
Copy link

try putting the whole timeline in a container
<v-container fluid> <v-timeline> . . . </v-timeline> </v-container>

@ReneS1991
Copy link

Hi,

I'd like to upvote this request as I'd like to achieve the following:

image

Currently I am overwriting the Vuetify CSS (mainly with some !importants 😞). Would be very nice if there is a build-in fix for this 😄

PS: I tried the fluid container but that doesn't make any difference.

@gza-slc
Copy link

gza-slc commented Sep 11, 2019

Upvoting too.

Basically the same issue as @ReneS1991, I would like to reduce the width of the left column and increase the width of the right one.

2019-09-11 21_20_05-serein io

@gjovanov
Copy link

gjovanov commented Dec 9, 2019

You can achieve this with some custom CSS e.g. to reduce from 96px to 64px, you can use this:

<style>
.v-timeline-item__divider {
  min-width: 64px;
}
.v-timeline--dense .v-timeline-item__body {
  max-width: calc(100% - 64px);
}
.v-application--is-ltr .v-timeline--dense:not(.v-timeline--reverse):before {
    left: calc(32px - 1px)
}
</style>

@nwaughachukwuma
Copy link

It doesn't work for me @gjovanov. I mean when trying to display opposite slot.

@vitaliy-ostapchuk93
Copy link

Have similar issues on mobile devices using the timeline. Dense will cause an overflow and the item decider will behave strange if there is no enough space.

@twilliams0001
Copy link

Same issue here. Need to provide text in the opposite slot with dense enabled. Until this option is available, does anyone have working CSS to accomplish it?

@sw34
Copy link

sw34 commented Jun 29, 2020

the following is working for me on vuetify 2.2.x

.v-timeline--dense .v-timeline-item__opposite {
  display: inline-block;
}

.v-timeline-item__opposite {
  flex: none;
}

/* line */
.v-application--is-ltr .v-timeline--dense:not(.v-timeline--reverse):before {
  left: 143px;
}

.opposite-width-force {
  display: inline-block;
  width: 95px;
  text-align: right;
}

@twilliams0001
Copy link

Thanks @sw34, this does the trick. I appreciate the help!

@aktentasche
Copy link

I took the CSS from @sw34 and modified it, so one can just write the desired width of the opposite item. I removed the opposite-width-force section as it had no effect for me. Also, one can adjust the line width of the line in the middle. Maybe this helps someone.

:root {
  --timeline-opposite-item-width: 160px;
  --timeline-line-width: 8px;
}

.v-timeline--dense .v-timeline-item__opposite {
  display: inline-block;
}

.v-timeline-item__opposite {
  flex: none;
  min-width: var(--timeline-opposite-item-width);
}

/* line: divider in the middle is 96px wide by default */
.v-application--is-ltr .v-timeline--dense:not(.v-timeline--reverse):before {
  left: calc(
    var(--timeline-opposite-item-width) + 
    (96px - var(--timeline-line-width)) / 2
  );
  width: var(--timeline-line-width);
}

@joaofavoretti
Copy link

joaofavoretti commented Feb 2, 2021

Try to use the dense property in v-timeline. It's done exactly what I wanted to do

@johnleider johnleider added this to the v3.0.0 milestone Apr 28, 2021
@johnleider johnleider added this to To do in Vuetify 3 - Titan via automation Apr 28, 2021
KaelWD added a commit that referenced this issue Jun 26, 2021
fixes #9370
fixes #5360
fixes #12971
fixes #11721
fixes #6594

Co-authored-by: Kael <kaelwd@gmail.com>
Co-authored-by: John Leider <john.j.leider@gmail.com>
@KaelWD KaelWD closed this as completed Jun 26, 2021
Vuetify 3 - Titan automation moved this from To do to Done Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VTimeline VTimeline T: feature A new feature
Projects
No open projects
Development

No branches or pull requests