Skip to content

Commit

Permalink
Optimize timeline layout for responsive design
Browse files Browse the repository at this point in the history
Added CSS custom properties to streamline the width calculations and adjusted the transform properties for better alignment and visual clarity. Enhanced readability and maintainability by consolidating these properties where applicable.
  • Loading branch information
essercodes committed Aug 18, 2024
1 parent 5cf385c commit 4848112
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/pages/Experience/timeline.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
.timeline {
margin: 1rem;
position: relative;
margin: 1rem;
position: relative;
--lanes: 2;
--line-width: .5rem;
}

.timeline .lines {
--lanes: 1;
position: absolute;
left: 50%;
rotate: 180deg;
top: 1rem;
bottom: 6rem;
position: absolute;
left: 50%;
rotate: 180deg;
top: 1rem;
bottom: 6rem;
width: calc(var(--line-width) * var(--lanes));
transform: translateX(1rem);
}

.timeline .center-line {
width: .5rem;
width: var(--line-width);
background: var(--bg2);
position: absolute;
}
Expand Down Expand Up @@ -43,8 +46,9 @@
@media (max-width: 768px) {

.timeline .lines {
left: calc(var(--lanes) * .5rem);
left: calc(var(--lanes) * .25rem);
justify-content: end;
transform: unset;
}

.timeline .exp-card {
Expand Down

0 comments on commit 4848112

Please sign in to comment.