~sircmpwn/core.sr.ht

8c8ca9d9c7fc62cc9596788cb01f38777227163f — Drew DeVault 10 months ago 9a95abb 0.66.0
Add dark theme support code
3 files changed, 222 insertions(+), 0 deletions(-)

M srht/scss/base.scss
A srht/scss/dark.scss
A srht/scss/highlight-dark.scss
M srht/scss/base.scss => srht/scss/base.scss +5 -0
@@ 155,6 155,7 @@ h5 {
      vertical-align: middle;
      padding: 0.1rem 0.75rem;
      border: 1px solid $gray-400;
      background: $white;

      label {
        margin-bottom: 0;


@@ 329,3 330,7 @@ code {
    }
  }
}

@media(prefers-color-scheme: dark) {
  @import "dark";
}

A srht/scss/dark.scss => srht/scss/dark.scss +157 -0
@@ 0,0 1,157 @@
$primary-dark: darken($primary, 10);
$success-dark: #2bb34b;
$danger-dark: #ff3e3e;
$muted-dark: $gray-400;
$link-dark: lighten($primary, 10);

body {
  background: $gray-900;
  color: $gray-100;
}

.event {
  background: $gray-800;

  a:not(.btn) {
    color: $link-dark;
  }
}

a {
  color: $link-dark;
}

h3, h4 {
  border-bottom-color: $gray-700;
}

pre {
  color: $gray-100;
  background: $gray-800;
}

code {
  color: $white;
}

.text-success {
  // Whose brilliant idea was it to make the text- classes !important in
  // bootstrap?
  color: $success-dark !important;
}

.text-danger {
  color: $danger-dark !important;
}

.text-muted {
  color: $muted-dark !important;
}

.alert-info {
  background: darken(#d1ecf1, 10);

  a {
    color: $primary;
  }
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="email"].form-control,
textarea,
textarea.form-control,
select.form-control:not([multiple]),
.form-control {
  background: $gray-800;
  color: $white;

  &:active, &:focus {
    background: $gray-900;
    color: $white;
  }

  &[disabled], &[readonly] {
    background: $gray-900;
    color: $gray-400;
  }
}

.btn {
  &.btn-default {
    background: $black;
    color: $white;
    border-color: $gray-700;

    &:hover {
      background: $gray-900;
      color: $white;
    }
  }

  &.btn-link {
    color: $link-dark;
  }
}

.table,
.table tbody tr,
.table tbody td,
.table thead th {
  background: $gray-800;
}

.table tbody td {
  border: 1px solid $gray-900;
}

.navbar-light {
  .navbar-brand,
  .navbar-brand a,
  .navbar-text,
  .navbar-text a,
  .navbar-text a:hover,
  .navbar-brand a:hover,
  .navbar-brand:hover {
    color: $white;
  }

  .navbar-nav {
    .nav-link {
      // gray-600 is too dark and gray-500 is too light
      color: lighten($gray-600, 5);

      &:hover {
        color: $white;
      }
    }

    .active .nav-link {
      color: $white;
    }
  }
}

.header-extension {
  background: $gray-800;
}

.header-tabbed {
  border-color: $gray-800;

  .nav {
    .nav-item .nav-link.active,
    .nav-item .nav-link:hover {
      color: $white;
      background: $gray-800;
      border-color: $gray-800;
    }

    .nav-link {
      color: $gray-400;
    }
  }
}

@import "highlight-dark";

A srht/scss/highlight-dark.scss => srht/scss/highlight-dark.scss +60 -0
@@ 0,0 1,60 @@
.highlight .hll { background-color: #49483e !important }
.highlight  { background: #272822; color: #f8f8f2 !important }
.highlight .c { color: #75715e !important } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 !important } /* Error */
.highlight .k { color: #66d9ef !important } /* Keyword */
.highlight .l { color: #ae81ff !important } /* Literal */
.highlight .n { color: #f8f8f2 !important } /* Name */
.highlight .o { color: #f92672 !important } /* Operator */
.highlight .p { color: #f8f8f2 !important } /* Punctuation */
.highlight .cm { color: #75715e !important } /* Comment.Multiline */
.highlight .cp { color: #75715e !important } /* Comment.Preproc */
.highlight .c1 { color: #75715e !important } /* Comment.Single */
.highlight .cs { color: #75715e !important } /* Comment.Special */
.highlight .ge { font-style: italic !important } /* Generic.Emph */
.highlight .gs { font-weight: bold !important } /* Generic.Strong */
.highlight .kc { color: #66d9ef !important } /* Keyword.Constant */
.highlight .kd { color: #66d9ef !important } /* Keyword.Declaration */
.highlight .kn { color: #f92672 !important } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef !important } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef !important } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef !important } /* Keyword.Type */
.highlight .ld { color: #e6db74 !important } /* Literal.Date */
.highlight .m { color: #ae81ff !important } /* Literal.Number */
.highlight .s { color: #e6db74 !important } /* Literal.String */
.highlight .na { color: #a6e22e !important } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 !important } /* Name.Builtin */
.highlight .nc { color: #a6e22e !important } /* Name.Class */
.highlight .no { color: #66d9ef !important } /* Name.Constant */
.highlight .nd { color: #a6e22e !important } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 !important } /* Name.Entity */
.highlight .ne { color: #a6e22e !important } /* Name.Exception */
.highlight .nf { color: #a6e22e !important } /* Name.Function */
.highlight .nl { color: #f8f8f2 !important } /* Name.Label */
.highlight .nn { color: #f8f8f2 !important } /* Name.Namespace */
.highlight .nx { color: #a6e22e !important } /* Name.Other */
.highlight .py { color: #f8f8f2 !important } /* Name.Property */
.highlight .nt { color: #f92672 !important } /* Name.Tag */
.highlight .nv { color: #f8f8f2 !important } /* Name.Variable */
.highlight .ow { color: #f92672 !important } /* Operator.Word */
.highlight .w { color: #f8f8f2 !important } /* Text.Whitespace */
.highlight .mf { color: #ae81ff !important } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff !important } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff !important } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff !important } /* Literal.Number.Oct */
.highlight .sb { color: #e6db74 !important } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 !important } /* Literal.String.Char */
.highlight .sd { color: #e6db74 !important } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 !important } /* Literal.String.Double */
.highlight .se { color: #ae81ff !important } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 !important } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 !important } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 !important } /* Literal.String.Other */
.highlight .sr { color: #e6db74 !important } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 !important } /* Literal.String.Single */
.highlight .ss { color: #e6db74 !important } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 !important } /* Name.Builtin.Pseudo */
.highlight .vc { color: #f8f8f2 !important } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 !important } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 !important } /* Name.Variable.Instance */
.highlight .il { color: #ae81ff !important } /* Literal.Number.Integer.Long */