diff options
Diffstat (limited to 'app/assets/stylesheets/highlight')
7 files changed, 54 insertions, 63 deletions
diff --git a/app/assets/stylesheets/highlight/common.scss b/app/assets/stylesheets/highlight/common.scss index 433141ae690..fcbd05141b9 100644 --- a/app/assets/stylesheets/highlight/common.scss +++ b/app/assets/stylesheets/highlight/common.scss @@ -29,36 +29,6 @@ } } -@mixin old-diff-expansion($background, $border, $link) { - background-color: $background; - - .diff-td, - td { - border-top: 1px solid $border; - border-bottom: 1px solid $border; - } - - button { - color: $link; - border: 0; - background: transparent; - - &[disabled] { - color: desaturate($link, 100%); - opacity: 0.5; - cursor: default; - } - - &:hover:not([disabled]) { - text-decoration: underline; - } - - &:not(:focus-visible) { - outline: 0; - } - } -} - @mixin dark-diff-expansion-line { &.expansion .diff-td { @@ -156,3 +126,11 @@ @include gl-display-inline-block; } } + +@mixin hljs-override($suffix, $color) { + &.blob-viewer { + .hljs-#{$suffix} { + color: $color; + } + } +} diff --git a/app/assets/stylesheets/highlight/themes/dark.scss b/app/assets/stylesheets/highlight/themes/dark.scss index 0eeebdb2e7a..f4d9909d81f 100644 --- a/app/assets/stylesheets/highlight/themes/dark.scss +++ b/app/assets/stylesheets/highlight/themes/dark.scss @@ -154,10 +154,6 @@ $dark-il: #de935f; color: $dark-line-color; } - .old-line_expansion { - @include old-diff-expansion($dark-main-bg, $dark-border, $dark-na); - } - .diff-line-expand-button { @include diff-expansion($gray-600, $gray-200, $gray-300, $white); } diff --git a/app/assets/stylesheets/highlight/themes/monokai.scss b/app/assets/stylesheets/highlight/themes/monokai.scss index b8cd97d6504..dfa32d4b773 100644 --- a/app/assets/stylesheets/highlight/themes/monokai.scss +++ b/app/assets/stylesheets/highlight/themes/monokai.scss @@ -96,6 +96,25 @@ $monokai-gh: #75715e; } .code.monokai { + // Highlight.js theme overrides (https://gitlab.com/gitlab-org/gitlab/-/issues/365167) + // We should be able to remove the overrides once the upstream issue is fixed (https://github.com/sourcegraph/sourcegraph/issues/23251) + @include hljs-override('string', $monokai-s); + @include hljs-override('attr', $monokai-na); + @include hljs-override('keyword', $monokai-k); + @include hljs-override('variable', $monokai-nv); + @include hljs-override('variable.language_', $monokai-k); + @include hljs-override('title', $monokai-nf); + @include hljs-override('name', $monokai-k); + @include hljs-override('tag', $monokai-nt); + @include hljs-override('type', $monokai-nc); + @include hljs-override('number', $monokai-mf); + @include hljs-override('literal', $monokai-kc); + @include hljs-override('built_in', $monokai-n); + @include hljs-override('section', $monokai-gh); + @include hljs-override('bullet', $monokai-n); + @include hljs-override('subst', $monokai-p); + @include hljs-override('symbol', $monokai-ni); + // Line numbers .file-line-num { @include line-number-link($monokai-line-num-color); @@ -125,10 +144,6 @@ $monokai-gh: #75715e; color: $monokai-text-color; } - .old-line_expansion { - @include old-diff-expansion($monokai-bg, $monokai-border, $monokai-k); - } - .diff-line-expand-button { @include diff-expansion($gray-600, $gray-200, $gray-300, $white); } diff --git a/app/assets/stylesheets/highlight/themes/none.scss b/app/assets/stylesheets/highlight/themes/none.scss index 99a3de23c26..f70c53c9eaa 100644 --- a/app/assets/stylesheets/highlight/themes/none.scss +++ b/app/assets/stylesheets/highlight/themes/none.scss @@ -15,6 +15,14 @@ } .code.none { + // Highlight.js theme overrides (https://gitlab.com/gitlab-org/gitlab/-/issues/365167) + // We should be able to remove the overrides once the upstream issue is fixed (https://github.com/sourcegraph/sourcegraph/issues/23251) + &.blob-viewer { + [class^="hljs-"] { + color: $gl-text-color; + } + } + // Line numbers .file-line-num { @include line-number-link($black-transparent); @@ -44,10 +52,6 @@ color: $gl-text-color; } - .old-line_expansion { - @include old-diff-expansion($gray-light, $white-normal, $gl-text-color); - } - .diff-line-expand-button { @include diff-expansion($gray-100, $gray-700, $gray-200, $gray-800); } diff --git a/app/assets/stylesheets/highlight/themes/solarized-dark.scss b/app/assets/stylesheets/highlight/themes/solarized-dark.scss index 55d17b8f1d2..73aa6275d17 100644 --- a/app/assets/stylesheets/highlight/themes/solarized-dark.scss +++ b/app/assets/stylesheets/highlight/themes/solarized-dark.scss @@ -99,6 +99,25 @@ $solarized-dark-il: #2aa198; } .code.solarized-dark { + // Highlight.js theme overrides (https://gitlab.com/gitlab-org/gitlab/-/issues/365167) + // We should be able to remove the overrides once the upstream issue is fixed (https://github.com/sourcegraph/sourcegraph/issues/23251) + @include hljs-override('string', $solarized-dark-s); + @include hljs-override('attr', $solarized-dark-na); + @include hljs-override('keyword', $solarized-dark-k); + @include hljs-override('variable', $solarized-dark-nv); + @include hljs-override('variable.language_', $solarized-dark-k); + @include hljs-override('title', $solarized-dark-nf); + @include hljs-override('name', $solarized-dark-k); + @include hljs-override('tag', $solarized-dark-nt); + @include hljs-override('type', $solarized-dark-nc); + @include hljs-override('number', $solarized-dark-mf); + @include hljs-override('literal', $solarized-dark-kc); + @include hljs-override('built_in', $solarized-dark-n); + @include hljs-override('section', $solarized-dark-gh); + @include hljs-override('bullet', $solarized-dark-n); + @include hljs-override('subst', $solarized-dark-p); + @include hljs-override('symbol', $solarized-dark-ni); + // Line numbers .file-line-num { @include line-number-link($solarized-dark-line-color); @@ -128,10 +147,6 @@ $solarized-dark-il: #2aa198; color: $solarized-dark-pre-color; } - .old-line_expansion { - @include old-diff-expansion($solarized-dark-line-bg, $solarized-dark-border, $solarized-dark-kd); - } - .diff-line-expand-button { @include diff-expansion(lighten($solarized-dark-pre-bg, 10%), $gray-200, lighten($solarized-dark-pre-bg, 20%), $white); } diff --git a/app/assets/stylesheets/highlight/themes/solarized-light.scss b/app/assets/stylesheets/highlight/themes/solarized-light.scss index 72b961097e4..74448317270 100644 --- a/app/assets/stylesheets/highlight/themes/solarized-light.scss +++ b/app/assets/stylesheets/highlight/themes/solarized-light.scss @@ -134,10 +134,6 @@ $solarized-light-il: #2aa198; background-color: $solarized-light-pre-bg; color: $solarized-light-pre-color; } - - .old-line_expansion { - @include old-diff-expansion($solarized-light-line-bg, $solarized-light-border, $solarized-light-kd); - } .diff-line-expand-button { @include diff-expansion($gray-100, $gray-700, $gray-200, $gray-800); diff --git a/app/assets/stylesheets/highlight/white_base.scss b/app/assets/stylesheets/highlight/white_base.scss index b984c194033..aac8ccde96e 100644 --- a/app/assets/stylesheets/highlight/white_base.scss +++ b/app/assets/stylesheets/highlight/white_base.scss @@ -133,19 +133,6 @@ pre.code, color: $white-code-color; } -.old-line_expansion { - @include old-diff-expansion($gray-light, $border-color, $blue-600); - - &.diff-tr:last-child { - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - - .diff-td { - border-bottom: 0; - } - } -} - .diff-line-expand-button { @include diff-expansion($gray-100, $gray-700, $gray-200, $gray-800); } |