I want it to turn out like this, but unfortunately my triangle goes into the background of the next stage. I spent 3 hours on it. Help please
I want it to turn out like this, but unfortunately my triangle goes into the background of the next stage. I spent 3 hours on it. Help please
3
Answers
This can easily be achieved with the use of ::before and ::after pseudo-elements – with one providing the background of the ‘next step’ and one providing the triangle with the ‘current step’ bg color.
Not sure if you neeed a elements in the lis – so I just did straight li’s but it would not be hard to change the styling for the use of a elements.
Its best not to try to to use opacity for the step differences – its more accessible to use hex codes directly rather than the one hex code with different opacity values.
Note that the solution of preventing the bleeding color is to space the li’s apart with margin and to use the before / after pseudo-elements to fill the gaps – its better to do this than overlap the element over he next step to prevent issues with clicking on areas that are covered by the triangles
Here it is done with polygon, adapt colors yourself
I had edited your stackbliz example. Please note the HTML and CSS changes.
Don’t use opacity to lighten the color. Instead, use SCSS lighten and darken methods.
Please utilize the most of the CSS than the HTML part for the assigning styles. Utilize the classes you have.
NOTE: Please take the benefit of SCSS variables, nesting and pre-defined methods.
Added the reverse z-index to stack the previous element to place over next element.
Below 6 is the total elements
https://stackblitz.com/edit/angular-jhk6qf?file=src/components/sales-funnel/sales-funnel.component.scss