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 codeblock style and add border-radius settings #194

Merged
merged 3 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ symbols_count_time:
awl: 5
wpm: 200

# Manual define the border radius in codeblock
# Leave it empty for the default 1
codeblock:
border_radius:

# Wechat Subscriber
#wechat_subscriber:
#enabled: true
Expand Down
11 changes: 8 additions & 3 deletions source/css/_common/components/highlight/highlight.styl
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ code {
color: $code-foreground;
background: $code-background;
border-radius: $code-border-radius;
font-size $code-font-size;
font-size: $code-font-size;
}

pre {
@extend $code-block;
padding: 10px;

code {
padding: 0;
color: $highlight-foreground;
Expand All @@ -39,7 +38,9 @@ pre {

.highlight {
@extend $code-block;
border-radius: 1px
// Read values from NexT config and set they as local variables to use as string variables (in any CSS section).
hexo-config('codeblock.border_radius') is a 'unit' ? (cbradius = unit(hexo-config('codeblock.border_radius'), px)) : (cbradius = 1px)
border-radius: cbradius;

pre {
border: none;
Expand All @@ -64,6 +65,10 @@ pre {
color: $highlight-foreground;
line-height: 1em;
margin-bottom: 1em;
margin: 0em;
padding: 0.5em;
background: $gainsboro;
border-bottom: 1px solid #e9e9e9;

a {
float: right;
Expand Down