Skip to content

Commit

Permalink
Disable selection for highlight meta (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang authored Jul 17, 2019
1 parent a362d70 commit 183e5b1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
3 changes: 2 additions & 1 deletion source/css/_common/components/highlight/copy-code.styl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
user-select: none;
outline: 0;
transition: opacity .3s ease-in-out;
opacity: 0;
disable-user-select();

if hexo-config('codeblock.copy_button.style') == 'flat' {
background-color: #fff;
border: none;
Expand Down
27 changes: 17 additions & 10 deletions source/css/_common/components/highlight/highlight.styl
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ pre {
}

.gutter {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
disable-user-select();
}

.gist table {
Expand All @@ -110,14 +107,24 @@ pre {
td { border: none; }
}

// For diff highlight
pre .deletion { background: $highlight-deletion; }
pre .addition { background: $highlight-addition; }
pre .meta { color: $highlight-purple; }

pre {
// For diff highlight
.deletion {
background: $highlight-deletion;
}

.addition {
background: $highlight-addition;
}

.comment { color: $highlight-comment; }
.meta {
color: $highlight-yellow;
disable-user-select();
}

.comment {
color: $highlight-comment;
}

.variable
.attribute
Expand Down
2 changes: 1 addition & 1 deletion source/css/_common/components/sidebar/sidebar-author.styl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
max-width: $site-author-image-width;
height: $site-author-image-height;
border: $site-author-image-border-width solid $site-author-image-border-color;
border-radius: 100% if hexo-config('avatar.rounded');
circle() if hexo-config('avatar.rounded');
}

if hexo-config('avatar.rotated') {
Expand Down
7 changes: 7 additions & 0 deletions source/css/_mixins/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,10 @@ disable-touch-hover() {
}
}
}

disable-user-select() {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

0 comments on commit 183e5b1

Please sign in to comment.