Giter Club home page Giter Club logo

Comments (1)

stephane-monnot avatar stephane-monnot commented on May 30, 2024 1

I tried your code sample, if I change border: 10px 0 0 0; to border: 10px solid transparent;, and add border-image-slice: 1;, I get :
image

But I think you want to create a border inside, right ? If so, I recommend you to create a div (wrapper) inside the vertical-timeline-element-content element and remove the padding of .vertical-timeline-element-content.
image

<VerticalTimelineElement
  className="vertical-timeline-element--work"
  date="2011 - present"
  iconStyle={{ background: 'rgb(33, 150, 243)', color: '#fff' }}
  icon={<WorkIcon />}
>
  <div className="vertical-timeline-element-content-box">
    <h3 className="vertical-timeline-element-title">Creative Director</h3>
    <h4 className="vertical-timeline-element-subtitle">Miami, FL</h4>
    <p>
      Creative Direction, User Experience, Visual Design, Project Management, Team Leading
    </p>
  </div>
</VerticalTimelineElement>
.vertical-timeline-element {
  .vertical-timeline-element-content-box {
    padding: 1em;
    border-radius: 0.25em;
    border: 4px solid transparent;
    border-image: linear-gradient(to right, #000000, #0098ED);
    border-image-slice: 1;
  }

  .vertical-timeline-element-content::before {
    border-left-color: #0098ED;
  }

  @media only screen and (min-width: 1170px) {
    .vertical-timeline-element-content .vertical-timeline-element-date {
      left: 136%;
    }

    &:nth-child(even):not(.vertical-timeline-element--left) .vertical-timeline-element-content .vertical-timeline-element-date, .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content .vertical-timeline-element-date {
      right: 136% !important;
    }
  }
}

from react-vertical-timeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.