mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
use faded primaryColor background for inline code snippets instead of link color (#276)
This commit is contained in:
parent
e655ac0f37
commit
c22203523f
5 changed files with 50 additions and 14 deletions
|
@ -13,6 +13,7 @@ function execute() {
|
|||
const readMetadata = require('./readMetadata.js');
|
||||
const renderToStaticMarkup = require('react-dom/server').renderToStaticMarkup;
|
||||
const path = require('path');
|
||||
const color = require('color');
|
||||
const toSlug = require('../core/toSlug.js');
|
||||
const React = require('react');
|
||||
const mkdirp = require('mkdirp');
|
||||
|
@ -355,6 +356,8 @@ function execute() {
|
|||
const color = siteConfig.colors[key];
|
||||
cssContent = cssContent.replace(new RegExp('\\$' + key, 'g'), color);
|
||||
});
|
||||
const codeColor = color(siteConfig.colors.primaryColor).alpha(0.07).string();
|
||||
cssContent = cssContent.replace(new RegExp('\\$codeColor', 'g'), codeColor);
|
||||
|
||||
mkdirp.sync(targetFile.replace(new RegExp('/[^/]*$'), ''));
|
||||
fs.writeFileSync(targetFile, cssContent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue