MOxFIVE / hexo-theme-yelee

简而不减 Hexo 双栏博客主题; Another simple and elegant theme for Hexo.
http://moxfive.xyz/
1.38k stars 328 forks source link

How to change colors of inline code block #83

Open kuncevic opened 8 years ago

kuncevic commented 8 years ago

Currently inline code block `and background has different color from{% codeblock %}`

image

What I want to do is to be able to set custom colors for text and bg for inline code block ``.

I want to be able to use current option with a green bg but also I want to be able to change inline code block bg and text colors for particular cases.

Do you have any ideas how to achieve that in sort of 'hexo way' without producing too much additional css rules just using mostly hexo functional or so ?

So basically single backticks `` will produce inline code block with green background with a white text - the way it is doing now(no changes):

image

but lets say to have an option to specify css inline_code right after single backticks ``(inline_code) or something like that.

image

Also I tried all inline_code's in config from 0 to 9 but there is no one that will match {% codeblock %} colors

MOxFIVE commented 8 years ago

Put this code to the end of yelee/source/css/style.styl

.article-entry code.match
    color highlight-foreground
    background highlight-background

Then specify inline code style via

<code class="match">if param1 > param2</code>


I am still looking for a better solution

https://hexo.io/docs/tag-plugins.html

kuncevic commented 8 years ago

So basically there is no way to play just with backticks ?

MOxFIVE commented 8 years ago

I will try to add some simple syntax to specify style

`(className) if param1 > param2`

`if param1 > param2`