Skip to content

Commit

Permalink
Change implementation of code snippets icons to be purely CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
JessSaavedra committed Feb 28, 2024
1 parent a03b28e commit 12b9dc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 45 deletions.
3 changes: 1 addition & 2 deletions docs/docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const remarkNamedSnippets = require('./scripts/remark-named-snippets/index');
const remarkCodeImport = require('remark-code-import');
const titleBasedIcon = require('./scripts/title-based-icon/index');

require('dotenv').config()

Expand Down Expand Up @@ -272,7 +271,7 @@ module.exports = {
includeCurrentVersion: true,
sidebarPath: require.resolve('./sidebars.js'),
// Note: remarkCodeImport is included to handle earlier versions with line number references (e.g. v0.14.13)
remarkPlugins: [remarkNamedSnippets, remarkCodeImport, titleBasedIcon],
remarkPlugins: [remarkNamedSnippets, remarkCodeImport],
// versions needs to map major.minor -> major.minor.patch for display purposes. Update the patch as needed.
versions: {
current: {
Expand Down
42 changes: 0 additions & 42 deletions docs/docusaurus/scripts/title-based-icon/index.js

This file was deleted.

3 changes: 2 additions & 1 deletion docs/docusaurus/src/css/code_block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ div.theme-code-block {
text-transform: capitalize;

&::before {
background: url('/img/file-solid.svg') 0 50% no-repeat;
content: '';
display: inline-block;
height: 1em;
Expand Down Expand Up @@ -68,7 +69,7 @@ div.theme-code-block {
background: url('/img/file-solid.svg') 0 50% no-repeat;
}

&.with-terminal-output-icon div:not(:only-child):first-child::before{
&.language-bash div:not(:only-child):first-child::before{
background: url('/img/terminal-input-icon.svg') 0 50% no-repeat;
width: 1.25em;
}
Expand Down

0 comments on commit 12b9dc7

Please sign in to comment.