aboutsummaryrefslogtreecommitdiffstats
path: root/root/static/style/sidenotes/text$x-scss.scss
blob: 0b9effede8fc0afc470348bc265346af69e05d50 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
$sidenote-width: 14rem;

:root {
  --sidenote-width: #{$sidenote-width};
}

.sidenote-container {
  margin-right: $sidenote-width + 1rem;

  @include media-medium {
    margin: auto;
  }

  .sidenote-container & {
    margin-right: initial;
    margin: initial;
  }

  .sidenote {
    position: absolute;
    box-sizing: border-box;

    width: $sidenote-width;
    right: -$sidenote-width - 2rem;
    padding: 0 1rem;

    color: $gray-dark;
    border-top: 1px solid $gray-dark;
    word-break: break-word;

    font-size: 0.8em;
    line-height: 1.1;
    text-align: initial;
    break-inside: avoid-page;

    .hook {
      position: absolute;
      top: -4rem;
      width: 0;
      height: 0;

      @media print {
        top: 0;
      }
    }

    .ref {
      display: block;
      position: absolute;

      width: 1rem;
      margin-left: -1.2rem;
      text-align: right;
    }

    > .markdown > p:first-child {
      margin-top: 0;
    }

    a {
      display: inline;
    }

    @include media-medium {
      width: initial;
      position: initial;
      right: initial;

      border-bottom: 1px solid $gray-dark;
      margin: 0.5rem 0;
    }
  }
}