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

chore: Update _syntax.scss to center code block and set maximum width #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions _sass/klise/_syntax.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ code {

// Codeblock Theme
pre.highlight, pre {
margin: 0 -27px;
margin: 0 auto; // Center the code block
max-width: 100%; // Set the maximum width of the code block to 100% of the parent container
@include media-query($on-mobile) {
margin: 0 calc(51% - 51vw);
margin: 0 auto; // Center on mobile devices as well
padding-left: 20px;
}
border: 1px solid rgba(128,128,128,0.1);
Expand All @@ -36,7 +37,7 @@ pre.highlight, pre {

> code {
width: 100%;
max-width: 50rem;
max-width: 100%; // Ensure the width of the code element does not exceed the pre element
margin-left: auto;
margin-right: auto;
line-height: 1.5;
Expand Down