browser/components/newtab/content-src/styles/_mixins.scss
author Ed Lee <edilee@mozilla.com>
Fri, 17 May 2019 22:55:09 +0000
changeset 533244 f78634b8bff9ce0b8850e5f9246e7821ded4ef4e
parent 532318 a07d7f8f53ca2bf81e5650a499481793c9b89fce
child 533915 23e2a740c60f3c90d0242cc21f0025bc0b26debe
permissions -rw-r--r--
Bug 1552599 - Add accessible links, focus refinements and bug fixes to Activity Stream r=k88hudson Differential Revision: https://phabricator.services.mozilla.com/D31691

// Shared styling of article images shown as background
@mixin image-as-background {
  background-color: var(--newtab-card-placeholder-color);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 4px;
  box-shadow: inset 0 0 0 0.5px $black-15;
}

// Note: lineHeight and fontSize should be unitless but can be derived from pixel values
// Bug 1550624 to clean up / remove this mixin that no longer limits lines
@mixin limit-visibile-lines($line-count, $line-height, $font-size) {
  font-size: $font-size * 1px;
  line-height: $line-height * 1px;
}

@mixin dark-theme-only {
  [lwt-newtab-brighttext] & {
    @content;
  }
}

@mixin ds-border-top {
  @content;

  @include dark-theme-only {
    border-top: 1px solid $grey-60;
  }

  border-top: 1px solid $grey-30;
}

@mixin ds-border-bottom {
  @content;

  @include dark-theme-only {
    border-bottom: 1px solid $grey-60;
  }

  border-bottom: 1px solid $grey-30;
}

@mixin ds-fade-in($halo-color: $blue-50-30) {
  box-shadow: 0 0 0 5px $halo-color;
  transition: box-shadow 150ms;
  border-radius: 4px;
  outline: none;
}