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

🐛 Fix code highlight issue #383

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
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
72 changes: 33 additions & 39 deletions assets/css/compiled/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1173,64 +1173,37 @@ body:has(#menu-controller:checked) {

/* Background */

.prose .chroma {
position: static;
.chroma {
border-radius: 0.375rem;
--tw-bg-opacity: 1;
background-color: rgba(var(--color-neutral-50), var(--tw-bg-opacity));
padding-top: 0.75rem;
padding-bottom: 0.75rem;
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-700), var(--tw-text-opacity));
}

.dark .prose .chroma {
.dark .chroma {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-neutral-700), var(--tw-bg-opacity));
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-200), var(--tw-text-opacity));
}

/* LineTableTD */

.chroma .lntd,
.chroma .lntd pre {
.chroma pre {
margin: 0px;
overflow: hidden;
border-style: none;
padding: 0px;
vertical-align: top;
}

/* LineTable */

.chroma .lntable {
margin: 0px;
display: block;
width: auto;
overflow-x: auto;
padding-top: 0.75rem;
padding-bottom: 0.75rem;
overflow: auto;
font-size: 1rem;
line-height: 1.5rem;
border-spacing: 0;
}

/* LineTable Line */

.chroma .lntable .line {
padding-right: 1rem;
}

/* LineHighlight */

.chroma .hl {
display: block;
width: auto;
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-100), var(--tw-bg-opacity));
}

.dark .chroma .hl {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity));
}

/* LineNumbersTable */
Expand All @@ -1239,11 +1212,9 @@ body:has(#menu-controller:checked) {

.chroma .lnt,
.chroma .ln {
margin-right: 0.4em;
padding-left: 0.4em;
padding-right: 0.4em;
padding-top: 0px;
padding-bottom: 0px;
margin-right: 0.5rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-600), var(--tw-text-opacity));
}
Expand All @@ -1254,6 +1225,29 @@ body:has(#menu-controller:checked) {
color: rgba(var(--color-neutral-300), var(--tw-text-opacity));
}

.chroma .lntd {
padding: 0px;
vertical-align: top;
}

.chroma .lntd:last-of-type {
width: 100%;
}

/* LineHighlight */

.chroma .hl {
display: block;
width: 100%;
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-100), var(--tw-bg-opacity));
}

.dark .chroma .hl {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity));
}

/* Keyword */

/* KeywordDeclaration */
Expand Down
33 changes: 16 additions & 17 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,32 +98,31 @@ body:has(#menu-controller:checked) {

/* -- Chroma Highlight -- */
/* Background */
.prose .chroma {
@apply static rounded-md bg-neutral-50 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-200;
.chroma {
@apply py-3 rounded-md bg-neutral-50 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-200;
}
/* LineTableTD */
.chroma .lntd,
.chroma .lntd pre {
@apply p-0 m-0 overflow-hidden align-top border-none;
.chroma pre {
@apply p-0 m-0;
}
/* LineTable */
.chroma .lntable {
@apply block w-auto py-3 overflow-x-auto text-base;
border-spacing: 0;
}
/* LineTable Line */
.chroma .lntable .line {
@apply pr-4;
}
/* LineHighlight */
.chroma .hl {
@apply block w-auto bg-primary-100 dark:bg-primary-900;
@apply block w-auto m-0 overflow-auto text-base;
}
/* LineNumbersTable */
/* LineNumbers */
.chroma .lnt,
.chroma .ln {
@apply mr-[0.4em] px-[0.4em] py-0 text-neutral-600 dark:text-neutral-300;
@apply px-2 mr-2 text-neutral-600 dark:text-neutral-300;
}
.chroma .lntd {
@apply p-0 align-top;
}
.chroma .lntd:last-of-type {
@apply w-full;
}
/* LineHighlight */
.chroma .hl {
@apply block w-full bg-primary-100 dark:bg-primary-900;
}
/* Keyword */
/* KeywordDeclaration */
Expand Down