Skip to content

Commit

Permalink
Fix scrollbar issue on safari and improve code scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
radito committed Apr 4, 2024
1 parent 71ac0ad commit a2f7aea
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 6 deletions.
5 changes: 3 additions & 2 deletions assets/css/common/post-single.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@

.post-content .highlight:not(table) {
margin: 10px auto;
background: var(--hljs-bg) !important;
background: transparent;
border: 1px solid var(--border);
border-radius: var(--radius);
direction: ltr;
}
Expand Down Expand Up @@ -205,7 +206,7 @@
margin: auto 0;
padding: 10px;
color: rgb(213, 213, 214);
/* background: var(--hljs-bg) !important; */
background: var(--code-bg) !important;
border-radius: var(--radius);
overflow-x: auto;
word-break: break-all;
Expand Down
17 changes: 15 additions & 2 deletions assets/css/extended/extmain.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@
transform: scale(103%);
}

.chroma > code{
.chroma > code {
transition: background-color 100ms ease-in-out, color 200ms ease-in-out;
}

.chroma > code::-webkit-scrollbar {
width: 0.35rem;
height: 0.35rem;
}
}
.chroma > code::-webkit-scrollbar-track {
background: transparent;
}

.chroma > code::-webkit-scrollbar-thumb {
border-width: 0px;
}

.chroma > code::-webkit-scrollbar-thumb {
background: var(--tertiary);
border: 2px;
border-radius: var(--radius);
}
63 changes: 63 additions & 0 deletions assets/css/includes/scroll-bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* from reset */
::-webkit-scrollbar-track {
background: var(--theme);
}

.list:not(.dark)::-webkit-scrollbar-track {
background: var(--code-bg);
}

::-webkit-scrollbar-thumb {
background: var(--tertiary);
border: 5px solid var(--theme);
border-radius: var(--radius);
}

.list:not(.dark)::-webkit-scrollbar-thumb {
border: 5px solid var(--code-bg);
}

::-webkit-scrollbar-thumb:hover {
background: var(--secondary);
}

::-webkit-scrollbar:not(.highlighttable, .highlight table, .gist .highlight) {
background: var(--theme);
}

/* from post-single */
.post-content .highlighttable td .highlight pre code::-webkit-scrollbar {
display: none;
}

.post-content :not(table) ::-webkit-scrollbar-thumb {
border: 2px solid var(--hljs-bg);
background: rgb(113, 113, 117);
}

.post-content :not(table) ::-webkit-scrollbar-thumb:hover {
background: rgb(163, 163, 165);
}

.gist table::-webkit-scrollbar-thumb {
border: 2px solid rgb(255, 255, 255);
background: rgb(173, 173, 173);
}

.gist table::-webkit-scrollbar-thumb:hover {
background: rgb(112, 112, 112);
}

.post-content table::-webkit-scrollbar-thumb {
border-width: 2px;
}

/* from zmedia */
@media screen and (min-width: 768px) {

/* reset */
::-webkit-scrollbar {
width: 19px;
height: 11px;
}
}
4 changes: 2 additions & 2 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@
background: var(--theme);
}

.list:not(.dark)::-webkit-scrollbar-track {
/* .list:not(.dark)::-webkit-scrollbar-track {
background: 0 0;
}

.list:not(.dark)::-webkit-scrollbar-thumb {
border-color: var(--theme);
}
} */
}
</style>
{{- end }}
Expand Down

0 comments on commit a2f7aea

Please sign in to comment.