Skip to content

Commit

Permalink
feat(styles): Update code block syntax mixin
Browse files Browse the repository at this point in the history
- Updated the `code-block-syntax` mixin in `_mixins.scss`
- Added support for multiple languages by accepting an array of language names
- Each language now has its own CSS class and pre tag styling

This commit improves the flexibility and extensibility of the code block syntax mixin, allowing it to handle multiple programming languages more effectively.
  • Loading branch information
SakuraIsayeki committed Jul 5, 2024
1 parent 75a34f6 commit cd06151
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nodsoft_moltenobsidian_web/src/styles/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ table, .table {
@include callout-color("info", rgb(0, 122, 255));
}

@include code-block-syntax("csharp") {
@include code-block-syntax("csharp", "cs") {
@import "syntax/csharp";
}
8 changes: 5 additions & 3 deletions nodsoft_moltenobsidian_web/src/styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
font-size: 90%;
}

@mixin code-block-syntax($lang) {
.lang-#{$lang} .#{$lang} pre {
@content;
@mixin code-block-syntax($langs) {
@each $lang in $langs {
.lang-#{$lang} .#{$lang} pre {
@content;
}
}
}

0 comments on commit cd06151

Please sign in to comment.