1 | @mixin callout ($l-offset: 1.33rem) {
|
2 | --background: #{lighten(#dfe2e5, 8.75%)};
|
3 | --border: #{lighten(#6a737d, 12.5%)};
|
4 |
|
5 | & {
|
6 | background: var(--background);
|
7 | border-color: var(--border);
|
8 | color: var(--text);
|
9 | padding: $l-offset;
|
10 | }
|
11 |
|
12 | &_info {
|
13 | $color: #46b8da;
|
14 | --background: #e3edf2;
|
15 | --title: #{$color};
|
16 | --border: #{lighten($color, 5%)};
|
17 | }
|
18 |
|
19 | &_warn, &_warning {
|
20 | $color: #eea236;
|
21 | --background: #fcf8f2;
|
22 | --title: #{$color};
|
23 | --border: #{lighten($color, 5%)};
|
24 | }
|
25 |
|
26 | &_ok, &_okay, &_success {
|
27 | $color: #489e49;
|
28 | --background: #f3f8f3;
|
29 | --title: #{$color};
|
30 | --border: #{lighten($color, 5%)};
|
31 | }
|
32 |
|
33 | &_err, &_error {
|
34 | $color: #d43f3a;
|
35 | --background: #fdf7f7;
|
36 | --title: #{$color};
|
37 | --border: #{lighten($color, 5%)};
|
38 | }
|
39 |
|
40 | > * {
|
41 | margin-left: $l-offset;
|
42 | position: relative;
|
43 | }
|
44 | > ul, > ol {
|
45 | padding-left: 0;
|
46 | }
|
47 |
|
48 | a {
|
49 | color: inherit;
|
50 | }
|
51 | hr {
|
52 | border-color: var(--border, var(--markdown-edge, #eee));
|
53 | }
|
54 | blockquote {
|
55 | color: var(--text);
|
56 | border-color: var(--border);
|
57 | border-width: 3px;
|
58 | padding: 0 0 0 .8em;
|
59 | }
|
60 |
|
61 | .callout-heading {
|
62 | color: var(--title, --text);
|
63 | margin-bottom: calc(#{$l-offset} * .5);
|
64 | &:only-child {
|
65 | margin-bottom: 0;
|
66 | }
|
67 | &.empty {
|
68 | float: left;
|
69 | }
|
70 | > * {
|
71 | color: inherit;
|
72 | margin: 0;
|
73 | }
|
74 | &:before {
|
75 | position: absolute;
|
76 | right: 100%;
|
77 | width: 2.4em;
|
78 | text-align: center;
|
79 | font: normal normal normal 1em/1 FontAwesome;
|
80 | }
|
81 | }
|
82 | .callout-icon {
|
83 | float: left;
|
84 | margin-left: calc(-#{$l-offset} - .5em);
|
85 | margin-right: -.25rem;
|
86 | }
|
87 | }
|
88 | @mixin calloutCustomIcons($R: callout) {
|
89 | --emoji: 1em;
|
90 | --icon-font: FontAwesome;
|
91 | &-icon {
|
92 | font-size: var(--emoji, 0);
|
93 | color: var(--icon-color, inherit) !important;
|
94 | }
|
95 | &-icon:before {
|
96 | content: var(--icon);
|
97 | font-family: var(--icon-font);
|
98 | font-size: var(--icon-size, 1rem);
|
99 | font-weight: var(--icon-weight, 400);
|
100 | position: absolute;
|
101 | top: 50%;
|
102 | transform: translate(-50%, -50%);
|
103 | display: inline-block;
|
104 | text-rendering: auto;
|
105 | -webkit-font-smoothing: antialiased;
|
106 | -moz-osx-font-smoothing: grayscale;
|
107 | }
|
108 | @at-root .rdmdCallouts--useIconFont & {
|
109 | --emoji: unset;
|
110 | &_okay {
|
111 |
|
112 | --icon: "\f164";
|
113 | }
|
114 | &_info {
|
115 |
|
116 | --icon: "\f05a";
|
117 | }
|
118 | &_warn {
|
119 |
|
120 | --icon: "\f071";
|
121 | }
|
122 | &_error {
|
123 |
|
124 | --icon: "\f06a";
|
125 | }
|
126 | &_default {
|
127 |
|
128 | --emoji: 1rem;
|
129 | }
|
130 | }
|
131 | }
|
132 |
|
133 | .callout {
|
134 | &.callout {
|
135 | @include callout;
|
136 | }
|
137 | @include calloutCustomIcons;
|
138 | border-top-right-radius: var(--markdown-radius);
|
139 | border-bottom-right-radius: var(--markdown-radius);
|
140 | }
|