Sha256: 7e00fcc342a9f1bc485554bfe854b2fe2bf29ac26b30076b2cead2f4df0f1f91

Contents?: true

Size: 1.82 KB

Versions: 147

Compression:

Stored size: 1.82 KB

Contents

// stylelint-disable selector-attribute-quotes

@import "../../functions";
@import "../../variables";
@import "../../variables-dark";
@import "../../maps";
@import "../../mixins";

@include describe("global $color-mode-type: data") {
  @include it("generates data attribute selectors for dark mode") {
    @include assert() {
      @include output() {
        @include color-mode(dark) {
          .element {
            color: var(--bs-primary-text-emphasis);
            background-color: var(--bs-primary-bg-subtle);
          }
        }
        @include color-mode(dark, true) {
          --custom-color: #{mix($indigo, $blue, 50%)};
        }
      }
      @include expect() {
        [data-bs-theme=dark] .element {
          color: var(--bs-primary-text-emphasis);
          background-color: var(--bs-primary-bg-subtle);
        }
        [data-bs-theme=dark] {
          --custom-color: #3a3ff8;
        }
      }
    }
  }
}

@include describe("global $color-mode-type: media-query") {
  @include it("generates media queries for dark mode") {
    $color-mode-type: media-query !global;

    @include assert() {
      @include output() {
        @include color-mode(dark) {
          .element {
            color: var(--bs-primary-text-emphasis);
            background-color: var(--bs-primary-bg-subtle);
          }
        }
        @include color-mode(dark, true) {
          --custom-color: #{mix($indigo, $blue, 50%)};
        }
      }
      @include expect() {
        @media (prefers-color-scheme: dark) {
          .element {
            color: var(--bs-primary-text-emphasis);
            background-color: var(--bs-primary-bg-subtle);
          }
        }
        @media (prefers-color-scheme: dark) {
          :root {
            --custom-color: #3a3ff8;
          }
        }
      }
    }

    $color-mode-type: data !global;
  }
}

Version data entries

147 entries across 147 versions & 8 rubygems

Version Path
cm-admin-4.0.0 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.16 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.15 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.14 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.13 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.12 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.11 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.10 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.9 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.8 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.7 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.6 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.5 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.4 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.3 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.2 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.1 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-3.0.0 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-2.4.6 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss
cm-admin-2.4.5 app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss