Skip to content

Stylus Modernized by Tiago

Screenshot of Stylus Modernized

Details

AuthorTiago

LicenseNo License

CategoryStylus extension

Created

Updated

Size10 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Userstyle for the stylus extension.

Notes

Userstyle doesn't have notes.

Source code

Source code has over 10K characters, so we truncated it. You can inspect the full source code on install link.
/* ==UserStyle==
@name           Stylus modernized
@namespace      github.com/openstyles/stylus
@version        1.1.1
@description    Userstyle for the Stylus extension
@author         Tiago
==/UserStyle== */
@-moz-document url-prefix("chrome-extension://clngdbkpkpeebahjckkjfobafhncgmne"),
url-prefix("moz-extension://0e9e0a94-777a-44f6-8235-3b1de2284444") {

  :root {
    --custom-css-background-color-1: #f1f1f7;
    --custom-css-background-color-2: white;
    --custom-css-input-padding: 0 .8rem;
    --custom-css-input-height: 2rem;
    --custom-css-input-border: 1px solid #e6e6e6;
    --custom-css-button-color: #f5f7f9;
    --custom-css-button-color-hover: #eee;
    --custom-css-button-color-active: white;
    --custom-css-button-color-foreground: black;
    --custom-css-field-bg-color: #eee;
    --custom-css-primary-accent-color: #1998ff;
    --custom-css-primary-accent-color-faded: lightgray;
    --custom-css-primary-accent-color-hover: #63aafb;
    --custom-css-primary-accent-color-active: #1489fb;
    --custom-css-primary-accent-foreground: white;
    --custom-css-foreground-color: black;
    --custom-css-button-color-highlight: gold;
    --custom-css-radius-1: 1rem;
    --custom-css-radius-2: .5rem;
    --custom-css-radius-3: .2rem;
    --custom-css-gap-1: 1rem;
    --custom-css-gap-2: .6rem;
    --custom-css-gap-3: .2rem;
    transition: --custom-css-background-color-2 200ms ease;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --custom-css-background-color-1: #000003;
      --custom-css-background-color-2: #101010;
      --custom-css-input-padding: 0 .8rem;
      --custom-css-input-height: 2rem;
      --custom-css-input-border: 1px solid #fff0;
      --custom-css-button-color: #3e3e3e;
      --custom-css-button-color-hover: #2f2f2f;
      --custom-css-button-color-active: #4e4e4e;
      --custom-css-button-color-foreground: white;
      --custom-css-field-bg-color: #272727;
      --custom-css-primary-accent-color: #37a5ff;
      --custom-css-primary-accent-color-faded: #2a2a2a;
      --custom-css-primary-accent-color-hover: #2c88f1;
      --custom-css-primary-accent-color-active: #1e8efa;
      --custom-css-primary-accent-foreground: white;
      --custom-css-foreground-color: white;
      --custom-css-button-color-highlight: goldenrod;
      --custom-css-radius-1: 1rem;
      --custom-css-radius-2: .5rem;
      --custom-css-radius-3: .2rem;
      --custom-css-gap-1: 1rem;
      --custom-css-gap-2: .6rem;
      --custom-css-gap-3: .2rem;
    }
  }
  
  body > div, .CodeMirror {
    transition: background-color 200ms ease;
  }

  /* global styling */
  button {
    padding: var(--custom-css-input-padding);
    border-radius: var(--custom-css-radius-2);
    border: var(--custom-css-input-border) !important;
    background-color: var(--custom-css-button-color);
    color: var(--custom-css-button-color-foreground);
    background-image: none;
    min-height: var(--custom-css-input-height);
  }
  button:not(:disabled):hover,
  button:not(:disabled):focus-visible {
    background-color: var(--custom-css-button-color-hover);
    background-image: none;
  }
  button:not(:disabled):active {
    background-color: var(--custom-css-button-color-active);
    background-image: none;
  }

  button:disabled {
    filter: contrast(0.5) brightness(1.2);
    color: inherit;
    background-color: var(--custom-css-button-color);
  }

  .split-btn button:first-child {
    border-radius: var(--custom-css-radius-2) 0 0 var(--custom-css-radius-2);
  }

  input[type='text'],
  input[type='search'],
  input[type='number'],
  input[type='url'],
  input:not([type]),
  select,
  #search,
  #sort-wrapper select,
  textarea {
    font-size: .8rem;
    background-color: var(--custom-css-field-bg-color);
    padding: var(--custom-css-input-padding);
    height: unset;
    border-radius: var(--custom-css-radius-2);
    border: var(--custom-css-input-border);
    min-height: var(--custom-css-input-height) !important;
  }

  .select-wrapper::after {
    content: '⋁';
    color: inherit;
    top: 25% !important;
  }

  input[type="checkbox"]:not(.slider) {
    border: var(--custom-css-input-border);
    height: 1rem;
    width: 1rem;
    display: inline-grid;
    place-items: center;
    border-radius: var(--custom-css-radius-3);
    background-color: var(--custom-css-primary-accent-color-faded);
    color: var(--custom-css-primary-accent-foreground);
    flex-basis: 1rem;
    margin: var(--custom-css-input-padding);
  }
  input[type="checkbox"]:not(.slider):checked {
    background-color: var(--custom-css-primary-accent-color-active);
  }

  input[type="radio"] {
    height: 1rem;
    width: 1rem;
    margin: var(--custom-css-input-padding);
    background: var(--custom-css-primary-accent-color-faded);
    border: var(--custom-css-input-border);
  }
  input[type="radio"]:checked::after {
    inset: .2rem;
    background-color: var(--custom-css-primary-accent-color-active);
    width: unset;
    height: unset;
  }

  .slider {
    --width: 1rem;
    --knob: 1rem;
    --color-off: var(--custom-css-primary-accent-color-faded);
    --color-on: var(--custom-css-primary-accent-color-active);
    border: var(--custom-css-input-border);
    box-shadow: none !important;
    height: 1.4rem;
    padding: .2rem;
    background: var(--color-off);
  }
  .slider::after {
    box-shadow: none;
    background: var(--custom-css-background-color-2) !important;
    border: none;
  }

  :focus,
  .CodeMirror-focused,
  textarea[data-focused-via-click]:not(.does-not-exist):focus,
  input[data-focused-via-click]:not([type]):focus,
  input[type="text"][data-focused-via-click]:focus,
  input[type="url"][data-focused-via-click]:focus,
  input[type="search"][data-focused-via-click]:focus,
  input[type="number"][data-focused-via-click]:focus {
    outline: none;
    box-shadow: var(--focus-shadow);
    --focus-color1: var(--custom-css-primary-accent-active);
    --focus-color2: var(--custom-css-primary-accent-color-hover);
    --focus-shadow: 0 0 0 2px var( --focus-color1), 0 0 5px var(--focus-color2);
    transition: box-shadow 100ms ease;
  }

  p:has( > button),
  .buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--custom-css-input-padding);
    justify-content: space-between;
    & > div, > button {
      margin: 0 !important;
    }
  }

  body {
    background-color: var(--custom-css-background-color-2);
    color: var(--custom-css-foreground-color)
  }

  /* global view */
  #header {
    background-color: var(--custom-css-background-color-2);
  }

  #header .filter-selection label {
    height: 2.5em;
  }

  #header .filter-selection .select-wrapper::after {
    top: 20%;
  }

  .filter-selection select {
    height: unset;
  }

  #header details {
    margin-top: var(--custom-css-gap-1);
    padding: var(--custom-css-input-padding);
    transition: 100ms ease-out;
  }

  #sort-wrapper {
    padding: var(--custom-css-input-padding);
  }

  #header-resizer {
    opacity: 0;
  }

  .entry {
    min-height: 3rem;
    margin: .5rem;
    border-radius: var(--custom-css-radius-2);
    border: none !important;
    display: flex;
    align-items: center;
  }
  .entry:hover {
    background-color: var(--custom-css-background-color-1);
  }

  ::-webkit-scrollbar {
    width: 1rem;
    height: 1rem;
    background-color: var(--custom-css-background-color-2);
  }
  ::-webkit-scrollbar-thumb {
    border-radius: 1rem;
    background-color: var(--custom-css-primary-accent-color);
    border: .3rem solid var(--custom-css-background-color-2);
    transition: 50ms ease;
  }
  ::-webkit-scrollbar-thumb:hover {
    background-color: var(--custom-css-primary-accent-color-hover);
    border: .2rem solid var(--custom-css-background-color-2);
  }

  #search-wrapper,
  #sort-wrapper {
    gap: var(--custom-css-gap-2);
  }

  .filter-selection .select-wrapper {
    left: calc(2rem + var(--custom-css-gap-2));
  }

  section.aligned > * + * {
    margin-top: var(--custom-css-gap-2);
  }
  section.aligned {
    display: grid;
  }
  section.aligned > * {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: start;
  }
  section.aligned > * :nth-child(3) {
    position: absolute;
    top: calc(var(--custom-css-input-height) / 2 - .5rem);
    right: var(--custom-css-gap-2);
  }

  .settings > main > section:not(.aligned) > * {
    padding: var(--custom-css-gap-3) 0;
  }
  .settings > main > section:not(.aligned) label {
    flex-grow: 1;
    display: flex;
  }
  .settings > main > section:not(.aligned) > div {
    padding-right: var(--custom-css-gap-2);
  }
  /* editor view */
  .dirty #save-button,
  .dirty #save-button + button {
    background: var(--custom-css-button-color-highlight);
    color: var(--custom-css-button-color-foreground);
  }
  .applies-to li .applies-value-wrapper {
    place-items: center;
  }

  /* overwrite editor style */
  .CodeMirror {
    background-color: var(--custom-css-background-color-2);
  }

  .CodeMirror-gutters {
    background-color: var(--custom-css-background-color-1);
    color: var(--custom-css-foreground-color);
    border-right: var(--custom-css-input-border);
  }
  .CodeMirror-linenumber {
    color: inherit;
  }
  .CodeMirror .applies-to {
    background-color: var(--custom-css-background-color-1);
    border-top: var(--custom-css-input-border);
    border-bottom: var(--custom-css-input-border);
  }
  .applies-to input,
  .applies-to select {
    border: var(--custom-css-input-border) !important;
  }

  /* popup */
  #stylus-popup {
    width: 20rem;
    max-width: 25rem !important
  }
  #message-box > div {
    overflow: hidden;
    border-radius: var(--custom-css-radius-1);
    background-color: var(--custom-css-background-color-2);
  }
  #message-box-title {
    padding: 1.5rem 3rem 1.5rem 5rem;
  }
  #message-box-close-icon {
    right: 1rem;
    top: 1rem;
  }
  #newStyleAsUsercss:checked,
  #newStyleAsUsercss:checked + i {
    margin: var(--custom-css-input-padding)...

Reviews

No reviews yet.