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

Modify inline code color in _base.scss not working #698

Closed
1 task
secsilm opened this issue Jan 9, 2022 · 4 comments
Closed
1 task

Modify inline code color in _base.scss not working #698

secsilm opened this issue Jan 9, 2022 · 4 comments
Assignees

Comments

@secsilm
Copy link

secsilm commented Jan 9, 2022

First of all, Thanks for your great theme!

Description

I tried to modify inline code styles and successfully modified some of them. I followed the instructions in #10 (comment).

But I cannot make it through modifying tranquilpeak\source\_css\base\_base.scss as follows:

// inline code
code {
    font-size:        85%;  // map-get($font-size, medium)
    // display:          inline-block;
    font-family:      map-get($font-families, 'code');
    font-weight:      400;
    background-color: rgba(175,184,193,0.2);   // <-- THIS is not working
    padding:          0.2em 0.4em;
    margin: 0;
    border-radius: 6px;
}

Chrome dev tools:

image

You can see it's crossed out. Also you can view the screenshot page here.

Expected behavior

Change the inline code background color to rgba(175,184,193,0.2):

image

Steps to reproduce the bug

Environment

  • Operating system with version : Windows 10
  • Node version: v13.14.0
  • Hexo version: 3.4.4
  • Hexo-cli version: 4.2.0
  • Tranquilpeak version: 4.1.3
  • Site configuration file:
  • Theme configuration file:
  • Hexo plugin:

Additional information

  • I can fix this bug
@LouisBarranqueiro
Copy link
Owner

👋 @secsilm, it works, it's just that this property is overridden by another one:
Screen Shot 2022-01-12 at 9 35 19 PM

@secsilm
Copy link
Author

secsilm commented Jan 14, 2022

@LouisBarranqueiro Then how do I keep it from being overridden?

@LouisBarranqueiro
Copy link
Owner

I can't really tell because you modified the code of the theme. You need to search in the different files where the property background-color:#f7f8f8; is set and remove it.

@secsilm
Copy link
Author

secsilm commented Jan 15, 2022

OK, I finally get it worked. Here are the steps:

  1. Modifying the inline code color as above.

  2. Comment out background in _variables.scss as following:

    // Highlight code
    $highlight: (
        // 'background':  #f7f8f8,  // <-- COMMENT OUT HERE
        'font-size':   1.4rem,
        'border':      1px solid,
        'line-height': 1.3em
    );
  3. The above code will result in losing backround color of the pre code, so we have to specify the background color in _code.scss:

    // Reset for tag `pre` and  for class `.gutter`, `.code`, `.tag`
        pre,
        .gutter,
        .code,
        .tag {
            background-color: #f7f8f8;  // <-- MODIFY COLOR HERE
            font-family:      #{map-get($font-families, 'highlight')};
            border:           none;
            padding:          0;
            margin:           0;
            // To override cursor attribute of `.tag` components
            cursor:           text;
        }
  4. npm run prod

@secsilm secsilm closed this as completed Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants