Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: Toolbar spacing & alignment with scrolling bar #3831

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions plugins/toolbar/prism-toolbar.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
div.code-toolbar {
position: relative;

/* ensuring position of the elements is in front of everything else so that the scrolling bar isn't blocking anything */
z-index: 999;
}

div.code-toolbar > .toolbar {
position: absolute;
z-index: 10;
top: .3em;
bottom: .3em;
right: .2em;
transition: opacity 0.3s ease-in-out;
opacity: 0;
margin-right: 0.5em;
}

div.code-toolbar:hover > .toolbar {
opacity: 1;
color: black;
}

/* Separate line b/c rules are thrown out if selector is invalid.
Expand All @@ -23,6 +28,9 @@ div.code-toolbar:focus-within > .toolbar {

div.code-toolbar > .toolbar > .toolbar-item {
display: inline-block;

/* controlling padding btwn elements */
margin-right: 0.5em;
}

div.code-toolbar > .toolbar > .toolbar-item > a {
Expand All @@ -46,7 +54,7 @@ div.code-toolbar > .toolbar > .toolbar-item > a,
div.code-toolbar > .toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar > .toolbar-item > span {
color: #bbb;
font-size: .8em;
font-size: .75em;
padding: 0 .5em;
background: #f5f2f0;
background: rgba(224, 224, 224, 0.2);
Expand Down
4 changes: 3 additions & 1 deletion themes/prism.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ code[class*="language-"]::selection, code[class*="language-"] ::selection {

/* Code blocks */
pre[class*="language-"] {
padding: 1em;

/* changing padding for single liners where the code was smushed */
padding: 2em;
margin: .5em 0;
overflow: auto;
}
Expand Down
Loading