Skip to content

Commit

Permalink
Refactor transitions for consistency across styles (#2025)
Browse files Browse the repository at this point in the history
  • Loading branch information
hichemfantar authored Jan 18, 2025
1 parent d2ddfc1 commit 8854816
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 18 deletions.
4 changes: 2 additions & 2 deletions assets/css/autocomplete.css
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
display: block;
padding: 12px 20px;
text-decoration: none;
transition: background-color 0.3s ease-in-out;
transition: var(--transition-colors);
border-top: 1px solid var(--suggestionBorder);
font-size: 0.9rem;
}
Expand Down Expand Up @@ -169,7 +169,7 @@
text-decoration: none;
border: 1px solid var(--suggestionBorder);
border-radius: var(--borderRadius);
transition: color .3s ease-in-out;
transition: var(--transition-colors);
background-color: var(--autocompletePreview);
cursor: pointer;
padding: 4px 8px;
Expand Down
1 change: 1 addition & 0 deletions assets/css/content/bottom-actions.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
border: 1px solid var(--bottomActionsBtnBorder);
padding: 12px 16px;
min-width: 150px;
transition: var(--transition-all);
}

.content-inner .bottom-actions .bottom-actions-button:hover {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/content/functions.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}

.content-inner .detail-header a.detail-link {
transition: opacity 0.3s ease-in-out;
transition: var(--transition-opacity);
position: absolute;
top: 0;
left: 0;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/content/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
color: var(--iconAction);
text-decoration: none;
border: none;
transition: color 0.3s ease-in-out;
transition: var(--transition-colors);
background-color: transparent;
cursor: pointer;
}
Expand Down
4 changes: 2 additions & 2 deletions assets/css/copy-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pre .copy-button:focus {
border-radius: var(--borderRadius);
border: none;
cursor: pointer;
transition: all 150ms;
transition: var(--transition-all);
font-family: var(--defaultFontFamily);
font-size: 14px;
line-height: 24px;
Expand All @@ -32,7 +32,7 @@ pre .copy-button:focus {

.copy-button svg {
opacity: 0.5;
transition: all 150ms;
transition: var(--transition-all);
}

pre .copy-button:hover svg,
Expand Down
14 changes: 14 additions & 0 deletions assets/css/custom-props/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@
--black-opacity-50: hsla(0, 0%, 0%, 50%);
--orangeDark: hsl(30, 90%, 40%);
--orangeLight: hsl(30, 80%, 50%);

--transition-duration: 150ms;
--transition-timing: cubic-bezier(0.4, 0, 0.2, 1);

--transition-all: all var(--transition-duration) var(--transition-timing);

--transition-colors: color var(--transition-duration) var(--transition-timing),
background-color var(--transition-duration) var(--transition-timing),
border-color var(--transition-duration) var(--transition-timing),
text-decoration-color var(--transition-duration) var(--transition-timing),
fill var(--transition-duration) var(--transition-timing),
stroke var(--transition-duration) var(--transition-timing);

--transition-opacity: opacity var(--transition-duration) var(--transition-timing);
}

@media screen and (max-width: 768px) {
Expand Down
4 changes: 2 additions & 2 deletions assets/css/modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
margin-right: 30px;
padding-left: 0;
text-align: left;
transition: color 150ms;
transition: var(--transition-colors);
}
.modal .modal-title button:hover {
color: var(--main);
Expand All @@ -79,7 +79,7 @@
background-color: transparent;
color: var(--textHeaders);
border: none;
transition: opacity 150ms;
transition: var(--transition-opacity);
}
.modal .modal-close:hover {
opacity: 1;
Expand Down
6 changes: 4 additions & 2 deletions assets/css/search-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
height: 46px;
padding: 8px 35px 8px 43px;
width: 100%;
transition: var(--transition-all);
}

.top-search .search-bar .search-input::placeholder {
Expand Down Expand Up @@ -63,6 +64,7 @@
top: 60%;
transform: translateY(-60%);
z-index: 99;
transition: var(--transition-all);
}

.top-search .search-bar.selected .search-button,
Expand All @@ -85,7 +87,7 @@
position: absolute;
transform: scaleY(0);
top: calc(50% - 13px);
transition: 0.15s transform ease-out;
transition: var(--transition-all);
z-index: 99;
}

Expand Down Expand Up @@ -137,7 +139,7 @@

body.search-focused .search-bar .search-close-button {
transform: scaleY(1);
transition: transform 0.15s ease-out 0.15s;
transition: var(--transition-all);
}

@media screen and (hover: hover) {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/search.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

#search .result-id a {
text-decoration: none;
transition: color .1s ease-in-out;
transition: var(--transition-colors);
color: var(--links);
}
#search .result-id a:is(:visited, :active, :focus) {
Expand Down
8 changes: 4 additions & 4 deletions assets/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
color: var(--settingsInput);
border: 1px solid var(--settingsInputBorder);
border-radius: var(--borderRadius);
transition: border-color 150ms;
transition: var(--transition-all);
}
#settings-modal-content .input:focus {
border-color: var(--main);
Expand Down Expand Up @@ -56,7 +56,7 @@
width: 40px;
height: 20px;
user-select: none;
transition: all 150ms;
transition: var(--transition-all);
}

#settings-modal-content .switch-button__checkbox {
Expand All @@ -69,7 +69,7 @@
background-color: #91a4b7;
border: 3px solid #e5edf5;
cursor: pointer;
transition: all 300ms;
transition: var(--transition-all);
}

#settings-modal-content .switch-button__bg {
Expand All @@ -79,7 +79,7 @@
border-radius: 1000px;
background-color: #e5edf5;
cursor: pointer;
transition: all 300ms;
transition: var(--transition-all);
}

#settings-modal-content .switch-button__checkbox:checked {
Expand Down
6 changes: 3 additions & 3 deletions assets/css/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.sidebar a {
color: var(--sidebarAccentMain);
text-decoration: none;
transition: color 0.3s ease-in-out;
transition: var(--transition-colors);
}

.sidebar a:hover {
Expand Down Expand Up @@ -158,7 +158,7 @@
display: inline-block;
line-height: 27px;
padding: 4px 10px 2px 10px;
transition: all 150ms;
transition: var(--transition-all);
}

.sidebar .sidebar-list-nav button {
Expand All @@ -169,7 +169,7 @@
background-color: var(--sidebarInactiveItemMarker);
border-top: var(--navTabBorderWidth) solid var(--sidebarInactiveItemBorder);
color: var(--sidebarAccentMain);
transition: all 150ms;
transition: var(--transition-all);
}

.sidebar .sidebar-list-nav button[aria-selected] {
Expand Down

0 comments on commit 8854816

Please sign in to comment.