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

How to change line color for the timeline? #65

Closed
kdeasymoneysniper opened this issue May 7, 2020 · 10 comments
Closed

How to change line color for the timeline? #65

kdeasymoneysniper opened this issue May 7, 2020 · 10 comments

Comments

@kdeasymoneysniper
Copy link

I saw in your demo that you could change the line color for the timeline, but I am not sure how you did it, is it possible to help me with that, and provide the steps on how I can achieve a custom line color? Thanks!

@stephane-monnot
Copy link
Owner

stephane-monnot commented May 7, 2020

You can use this styles in your own css file to override the default styles :

/* CUSTOM LINE COLOR */
/* The line */
.vertical-timeline.vertical-timeline-custom-line::before {
  background: #424242;
}

/* Icon container's border */
.vertical-timeline.vertical-timeline-custom-line .vertical-timeline-element--work .vertical-timeline-element-icon {
  box-shadow: 0 0 0 4px #1976d2, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
}

.vertical-timeline.vertical-timeline-custom-line .vertical-timeline-element--education .vertical-timeline-element-icon {
  box-shadow: 0 0 0 4px #c2185b, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
}

Of course, you need to adapt the classes name and add vertical-timeline.vertical-timeline-custom-line to the VerticalTimeline element.

@kdeasymoneysniper
Copy link
Author

kdeasymoneysniper commented May 7, 2020 via email

@stephane-monnot
Copy link
Owner

If you create a css file and import it after my css file, it should work.

@kdeasymoneysniper
Copy link
Author

kdeasymoneysniper commented May 8, 2020 via email

@peril-patel
Copy link

peril-patel commented Jan 12, 2023

this is not working:(
anyone can guide me???

@mavsin
Copy link

mavsin commented Mar 1, 2023

Not working. :(

@stephane-monnot
Copy link
Owner

Could you provide more informations please ?

@N0t-Sur3
Copy link

N0t-Sur3 commented Mar 13, 2023

@peril-patel @mr-new-0509

Vertical Line | change color or hide it:

  1. add a class eg costum-line to the <VerticalTimeLine> element
  2. style .costum-line in the css file
// changes the vertical line color
 .costum-line:before {
  background: #FF5700;
}
// created a costum-lineh, that hides the line
.costum-lineh:before {
  background: none;
}

Icon Border | change color or hide it:

  1. add .vertical-timeline-element-icon to your css file
  2. style the box-shadow
// changes timeline icon border color
.vertical-timeline-element-icon {
box-shadow: #FF5700;
}
// hide timeline icon border
.vertical-timeline-element-icon {
 box-shadow: none; 
}
@@ vertical line = background | border of icons = box-shadow @@
@@ add the created class eg costum-line to the exported <VerticalTimeLine> @@

E.g. I defined the timeline in const ExperienceCard,
but I put ExperienceCard in the const Experience.
Here I add the above suggested costum-line like <VerticalTimeLine className="costum-line">,
which is exported in export default SectionWrapper(Experience, "work");.

@Sardar-Ali-Murad
Copy link

lineColor={ String }
Choose your timeline color (default: '#000').
So,
lineColor="red" in

@sellwawy
Copy link

sellwawy commented Sep 5, 2024

<VerticalTimeline lineColor={'rgb(2 6 23)'}>......

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

7 participants