summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSImage/_DSImage.scss
blob: b11bcdcf55423570337301fcc104d04eeb94b357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.ds-image {
  display: block;
  position: relative;
  opacity: 0;

  &.use-transition {
    transition: opacity 0.8s;
  }

  &.loaded {
    opacity: 1;
  }

  img,
  .placeholder-image,
  .broken-image {
    background-color: var(--newtab-element-secondary-color);
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .placeholder-image {
    overflow: hidden;
    background-color: var(--placeholderBackgroundColor);

    &::before {
      content: '';
      background-image: url('chrome://activity-stream/content/data/content/assets/pocket-swoosh.svg');
      background-repeat: no-repeat;
      background-position: center;
      transform: rotate(var(--placeholderBackgroundRotation));
      position: absolute;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      // We use margin-left over margin-inline-start on purpose.
      // This is because we are using it to offset an image's content,
      // and the image content is the same in ltr and rtl.
      margin-left: var(--placeholderBackgroundOffsetx); // stylelint-disable-line property-disallowed-list
      margin-top: var(--placeholderBackgroundOffsety);
      background-size: var(--placeholderBackgroundScale);
    }
  }
}