alchemy-media 0.5.2 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +11 -4
  2. package/assets/fonts/fontawesome6/fa-brands-400.ttf +0 -0
  3. package/assets/fonts/fontawesome6/fa-brands-400.woff2 +0 -0
  4. package/assets/fonts/fontawesome6/fa-regular-400.ttf +0 -0
  5. package/assets/fonts/fontawesome6/fa-regular-400.woff2 +0 -0
  6. package/assets/fonts/fontawesome6/fa-solid-900.ttf +0 -0
  7. package/assets/fonts/fontawesome6/fa-solid-900.woff2 +0 -0
  8. package/assets/fonts/fontawesome6/fa-v4compatibility.ttf +0 -0
  9. package/assets/fonts/fontawesome6/fa-v4compatibility.woff2 +0 -0
  10. package/assets/stylesheets/alchemy_icons.scss +68 -0
  11. package/assets/stylesheets/alchemy_svg.scss +9 -0
  12. package/assets/stylesheets/chimera/mediafield.less +1 -2
  13. package/assets/stylesheets/element/alchemy_file.scss +95 -0
  14. package/assets/stylesheets/fontawesome6/_animated.scss +153 -0
  15. package/assets/stylesheets/fontawesome6/_bordered-pulled.scss +20 -0
  16. package/assets/stylesheets/fontawesome6/_core.scss +33 -0
  17. package/assets/stylesheets/fontawesome6/_fixed-width.scss +7 -0
  18. package/assets/stylesheets/fontawesome6/_functions.scss +57 -0
  19. package/assets/stylesheets/fontawesome6/_icons.scss +9 -0
  20. package/assets/stylesheets/fontawesome6/_list.scss +18 -0
  21. package/assets/stylesheets/fontawesome6/_mixins.scss +73 -0
  22. package/assets/stylesheets/fontawesome6/_rotated-flipped.scss +31 -0
  23. package/assets/stylesheets/fontawesome6/_screen-reader.scss +14 -0
  24. package/assets/stylesheets/fontawesome6/_shims.scss +2027 -0
  25. package/assets/stylesheets/fontawesome6/_sizing.scss +16 -0
  26. package/assets/stylesheets/fontawesome6/_stacked.scss +32 -0
  27. package/assets/stylesheets/fontawesome6/_variables.scss +4885 -0
  28. package/assets/stylesheets/fontawesome6/brands.scss +30 -0
  29. package/assets/stylesheets/fontawesome6/fontawesome.scss +21 -0
  30. package/assets/stylesheets/fontawesome6/regular.scss +26 -0
  31. package/assets/stylesheets/fontawesome6/solid.scss +26 -0
  32. package/assets/stylesheets/fontawesome6/v4-shims.scss +11 -0
  33. package/bootstrap.js +1 -0
  34. package/controller/media_files_controller.js +20 -0
  35. package/controller/media_gallery_chimera_controller.js +1 -0
  36. package/element/al_file.js +275 -0
  37. package/element/al_ico_element.js +17 -0
  38. package/element/al_svg.js +81 -0
  39. package/helper/media_helper.js +56 -10
  40. package/helper/widgets/image_widget.js +46 -0
  41. package/{lib/field_type → helper_field}/file_field_type.js +5 -3
  42. package/lib/media_types/image_media_type.js +34 -9
  43. package/model/media_file_model.js +9 -3
  44. package/model/media_raw_model.js +529 -529
  45. package/package.json +6 -6
  46. package/view/element/al_file.hwk +18 -0
  47. package/view/form/inputs/edit/file.hwk +8 -0
  48. package/assets/scripts/chimera/mediafield.js +0 -451
package/CHANGELOG.md CHANGED
@@ -1,10 +1,17 @@
1
- ## 0.5.2 (2021-10-13)
1
+ ## 0.6.2 (2022-07-06)
2
2
 
3
- * Fix image picker
3
+ * Upgrade to Fontawesome 6
4
+ * Update `al-file` element
5
+ * Allow supplying a custom route for the !Media directive with `+` variables
4
6
 
5
- ## 0.5.1 (2021-09-10)
7
+ ## 0.6.1 (2022-06-02)
6
8
 
7
- * Use `@11ways/exiv2` npm package instead of the Github repository
9
+ * Do not use `cwebp` if the binary could not be found
10
+
11
+ ## 0.6.0 (2021-09-12)
12
+
13
+ * Add Media directive, which will load extra info (like alt & title attribute) for an image element automatically
14
+ * If an image identifier is a valid hexadecimal string, it is assumed a record is wanted. If not, it's a static image. (We only used to check for ObjectIDs)
8
15
 
9
16
  ## 0.5.0 (2020-07-21)
10
17
 
@@ -0,0 +1,68 @@
1
+ @import "fontawesome6/fontawesome.scss";
2
+ @import "fontawesome6/solid.scss";
3
+ @import "fontawesome6/brands.scss";
4
+
5
+ al-ico {
6
+ --fa-display: inline-flex;
7
+ @extend %fa-icon;
8
+ flex-flow: column;
9
+ justify-content: center;
10
+ align-content: center;
11
+ text-align: center;
12
+
13
+ &[type="arrow-left"] {
14
+ @extend .fas, .fa-angle-left;
15
+ }
16
+
17
+ &[type="arrow-left-double"] {
18
+ @extend .fas, .fa-angle-double-left;
19
+ }
20
+
21
+ &[type="arrow-right"] {
22
+ @extend .fas, .fa-angle-right;
23
+ }
24
+
25
+ &[type="arrow-right-double"] {
26
+ @extend .fas, .fa-angle-double-right;
27
+ }
28
+
29
+ &[type="sorting-arrow"] {
30
+ @extend .fas;
31
+
32
+ &.down {
33
+ @extend .fa-sort-alpha-up;
34
+ }
35
+
36
+ &.up {
37
+ @extend .fa-sort-alpha-down;
38
+ }
39
+ }
40
+
41
+ &[type="menu"] {
42
+ @extend .fas, .fa-bars;
43
+ }
44
+
45
+ &[type="edit"] {
46
+ @extend .fas, .fa-pencil-alt;
47
+ }
48
+
49
+ &[type="zoom-in"] {
50
+ @extend .fas, .fa-search-plus;
51
+ }
52
+
53
+ &[type="microphone"] {
54
+ @extend .fas, .fa-microphone-alt;
55
+ }
56
+
57
+ &[type="video"] {
58
+ @extend .fas, .fa-video;
59
+ }
60
+
61
+ &[type="plus"] {
62
+ @extend .fas, .fa-plus;
63
+ }
64
+
65
+ &[hidden] {
66
+ display: none !important;
67
+ }
68
+ }
@@ -0,0 +1,9 @@
1
+ al-svg {
2
+ display: inline-flex;
3
+
4
+ svg {
5
+ width: 100%;
6
+ height: 100%;
7
+ display: block;
8
+ }
9
+ }
@@ -136,10 +136,9 @@
136
136
  .chimeraGallery-thumb, .chimeraGallery-pickup {
137
137
  width: 15rem;
138
138
  height: 15rem;
139
- max-width: 25rem;
140
139
  }
141
140
 
142
- .js-he-dialog [data-he-template="chimera/editor/gallery_picker"] {
141
+ .js-he-dialog[data-he-template="chimera/editor/gallery_picker"] {
143
142
  width: 80vw;
144
143
 
145
144
  .chimeraGallery {
@@ -0,0 +1,95 @@
1
+ $basecolor: #f80;
2
+ $dropperbg: hsl(0,0%,90%);
3
+
4
+ al-file {
5
+ display: grid;
6
+ grid-template-columns: fit-content(10rem) fit-content(17rem);
7
+
8
+ // @TODO: not implemented yet!
9
+ .al-file-choose-existing {
10
+ display: none !important;
11
+ }
12
+
13
+ &:not(.uploading) .uploading-icon {
14
+ display: none;
15
+ }
16
+
17
+ &.uploading {
18
+ .empty-icon {
19
+ display: none !important;
20
+ }
21
+ }
22
+
23
+ .al-file-drop-target {
24
+ margin-right: 1rem;
25
+ position: relative;
26
+ cursor: pointer;
27
+ background: $dropperbg;
28
+ border-top: 1px solid darken($dropperbg, 10%);
29
+ border-radius: 4px;
30
+ min-width: 8rem;
31
+ min-height: 8rem;
32
+ height: 100%;
33
+ padding: 4px 6px 6px;
34
+ transition: all 0.2s;
35
+
36
+ input[type="file"] {
37
+ visibility: hidden;
38
+ }
39
+
40
+ al-ico {
41
+ position: absolute;
42
+ top: 0;
43
+ left: 0;
44
+ width: 100%;
45
+ height: 100%;
46
+ font-size: 4rem;
47
+ }
48
+
49
+ &:hover {
50
+ background: $basecolor;
51
+ border-top-color: darken($basecolor, 10%);
52
+ }
53
+
54
+ &:hover:before {
55
+ color: fadeout(#000, 40%);
56
+ }
57
+
58
+ .al-file-preview {
59
+ width: 100%;
60
+ height: 100%;
61
+ background: no-repeat center;
62
+ background-size: contain;
63
+ position: relative;
64
+ z-index: 2;
65
+
66
+ img {
67
+ width: 100%;
68
+ height: 100%;
69
+ object-fit: contain;
70
+ }
71
+ }
72
+ }
73
+
74
+ &.dropping {
75
+ .al-file-drop-target {
76
+ background: $basecolor;
77
+ border-top-color: darken($basecolor, 10%);
78
+
79
+ &:before {
80
+ color: fadeout(#000, 40%);
81
+ }
82
+ }
83
+ }
84
+
85
+ .al-file-right {
86
+ display: flex;
87
+ flex-flow: column;
88
+ justify-content: space-around;
89
+ gap: 0.5rem;
90
+ }
91
+
92
+ button {
93
+ min-height: 2rem;
94
+ }
95
+ }
@@ -0,0 +1,153 @@
1
+ // animating icons
2
+ // --------------------------
3
+
4
+ .#{$fa-css-prefix}-beat {
5
+ animation-name: #{$fa-css-prefix}-beat;
6
+ animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0);
7
+ animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
8
+ animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
9
+ animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
10
+ animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, ease-in-out);
11
+ }
12
+
13
+ .#{$fa-css-prefix}-bounce {
14
+ animation-name: #{$fa-css-prefix}-bounce;
15
+ animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0);
16
+ animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
17
+ animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
18
+ animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
19
+ animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, cubic-bezier(0.280, 0.840, 0.420, 1));
20
+ }
21
+
22
+ .#{$fa-css-prefix}-fade {
23
+ animation-name: #{$fa-css-prefix}-fade;
24
+ animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0);
25
+ animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
26
+ animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
27
+ animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
28
+ animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, cubic-bezier(.4,0,.6,1));
29
+ }
30
+
31
+ .#{$fa-css-prefix}-beat-fade {
32
+ animation-name: #{$fa-css-prefix}-beat-fade;
33
+ animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0);
34
+ animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
35
+ animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
36
+ animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
37
+ animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, cubic-bezier(.4,0,.6,1));
38
+ }
39
+
40
+ .#{$fa-css-prefix}-flip {
41
+ animation-name: #{$fa-css-prefix}-flip;
42
+ animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0);
43
+ animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
44
+ animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
45
+ animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
46
+ animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, ease-in-out);
47
+ }
48
+
49
+ .#{$fa-css-prefix}-shake {
50
+ animation-name: #{$fa-css-prefix}-shake;
51
+ animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0);
52
+ animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
53
+ animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
54
+ animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
55
+ animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, linear);
56
+ }
57
+
58
+ .#{$fa-css-prefix}-spin {
59
+ animation-name: #{$fa-css-prefix}-spin;
60
+ animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0);
61
+ animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
62
+ animation-duration: var(--#{$fa-css-prefix}-animation-duration, 2s);
63
+ animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
64
+ animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, linear);
65
+ }
66
+
67
+ .#{$fa-css-prefix}-spin-reverse {
68
+ --#{$fa-css-prefix}-animation-direction: reverse;
69
+ }
70
+
71
+ .#{$fa-css-prefix}-pulse,
72
+ .#{$fa-css-prefix}-spin-pulse {
73
+ animation-name: #{$fa-css-prefix}-spin;
74
+ animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
75
+ animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
76
+ animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
77
+ animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, steps(8));
78
+ }
79
+
80
+ // if agent or operating system prefers reduced motion, disable animations
81
+ // see: https://www.smashingmagazine.com/2020/09/design-reduced-motion-sensitivities/
82
+ // see: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
83
+ @media (prefers-reduced-motion: reduce) {
84
+ .#{$fa-css-prefix}-beat,
85
+ .#{$fa-css-prefix}-bounce,
86
+ .#{$fa-css-prefix}-fade,
87
+ .#{$fa-css-prefix}-beat-fade,
88
+ .#{$fa-css-prefix}-flip,
89
+ .#{$fa-css-prefix}-pulse,
90
+ .#{$fa-css-prefix}-shake,
91
+ .#{$fa-css-prefix}-spin,
92
+ .#{$fa-css-prefix}-spin-pulse {
93
+ animation-delay: -1ms;
94
+ animation-duration: 1ms;
95
+ animation-iteration-count: 1;
96
+ transition-delay: 0s;
97
+ transition-duration: 0s;
98
+ }
99
+ }
100
+
101
+ @keyframes #{$fa-css-prefix}-beat {
102
+ 0%, 90% { transform: scale(1); }
103
+ 45% { transform: scale(var(--#{$fa-css-prefix}-beat-scale, 1.25)); }
104
+ }
105
+
106
+ @keyframes #{$fa-css-prefix}-bounce {
107
+ 0% { transform: scale(1,1) translateY(0); }
108
+ 10% { transform: scale(var(--#{$fa-css-prefix}-bounce-start-scale-x, 1.1),var(--#{$fa-css-prefix}-bounce-start-scale-y, 0.9)) translateY(0); }
109
+ 30% { transform: scale(var(--#{$fa-css-prefix}-bounce-jump-scale-x, 0.9),var(--#{$fa-css-prefix}-bounce-jump-scale-y, 1.1)) translateY(var(--#{$fa-css-prefix}-bounce-height, -0.5em)); }
110
+ 50% { transform: scale(var(--#{$fa-css-prefix}-bounce-land-scale-x, 1.05),var(--#{$fa-css-prefix}-bounce-land-scale-y, 0.95)) translateY(0); }
111
+ 57% { transform: scale(1,1) translateY(var(--#{$fa-css-prefix}-bounce-rebound, -0.125em)); }
112
+ 64% { transform: scale(1,1) translateY(0); }
113
+ 100% { transform: scale(1,1) translateY(0); }
114
+ }
115
+
116
+ @keyframes #{$fa-css-prefix}-fade {
117
+ 50% { opacity: var(--#{$fa-css-prefix}-fade-opacity, 0.4); }
118
+ }
119
+
120
+ @keyframes #{$fa-css-prefix}-beat-fade {
121
+ 0%, 100% {
122
+ opacity: var(--#{$fa-css-prefix}-beat-fade-opacity, 0.4);
123
+ transform: scale(1);
124
+ }
125
+ 50% {
126
+ opacity: 1;
127
+ transform: scale(var(--#{$fa-css-prefix}-beat-fade-scale, 1.125));
128
+ }
129
+ }
130
+
131
+ @keyframes #{$fa-css-prefix}-flip {
132
+ 50% {
133
+ transform: rotate3d(var(--#{$fa-css-prefix}-flip-x, 0), var(--#{$fa-css-prefix}-flip-y, 1), var(--#{$fa-css-prefix}-flip-z, 0), var(--#{$fa-css-prefix}-flip-angle, -180deg));
134
+ }
135
+ }
136
+
137
+ @keyframes #{$fa-css-prefix}-shake {
138
+ 0% { transform: rotate(-15deg); }
139
+ 4% { transform: rotate(15deg); }
140
+ 8%, 24% { transform: rotate(-18deg); }
141
+ 12%, 28% { transform: rotate(18deg); }
142
+ 16% { transform: rotate(-22deg); }
143
+ 20% { transform: rotate(22deg); }
144
+ 32% { transform: rotate(-12deg); }
145
+ 36% { transform: rotate(12deg); }
146
+ 40%, 100% { transform: rotate(0deg); }
147
+ }
148
+
149
+ @keyframes #{$fa-css-prefix}-spin {
150
+ 0% { transform: rotate(0deg); }
151
+ 100% { transform: rotate(360deg); }
152
+ }
153
+
@@ -0,0 +1,20 @@
1
+ // bordered + pulled icons
2
+ // -------------------------
3
+
4
+ .#{$fa-css-prefix}-border {
5
+ border-color: var(--#{$fa-css-prefix}-border-color, #{$fa-border-color});
6
+ border-radius: var(--#{$fa-css-prefix}-border-radius, #{$fa-border-radius});
7
+ border-style: var(--#{$fa-css-prefix}-border-style, #{$fa-border-style});
8
+ border-width: var(--#{$fa-css-prefix}-border-width, #{$fa-border-width});
9
+ padding: var(--#{$fa-css-prefix}-border-padding, #{$fa-border-padding});
10
+ }
11
+
12
+ .#{$fa-css-prefix}-pull-left {
13
+ float: left;
14
+ margin-right: var(--#{$fa-css-prefix}-pull-margin, #{$fa-pull-margin});
15
+ }
16
+
17
+ .#{$fa-css-prefix}-pull-right {
18
+ float: right;
19
+ margin-left: var(--#{$fa-css-prefix}-pull-margin, #{$fa-pull-margin});
20
+ }
@@ -0,0 +1,33 @@
1
+ // base icon class definition
2
+ // -------------------------
3
+
4
+ .#{$fa-css-prefix} {
5
+ font-family: var(--#{$fa-css-prefix}-style-family, '#{$fa-style-family}');
6
+ font-weight: var(--#{$fa-css-prefix}-style, #{$fa-style});
7
+ }
8
+
9
+ .#{$fa-css-prefix},
10
+ .fas,
11
+ .#{$fa-css-prefix}-solid,
12
+ .far,
13
+ .#{$fa-css-prefix}-regular,
14
+ .fal,
15
+ .#{$fa-css-prefix}-light,
16
+ .fat,
17
+ .#{$fa-css-prefix}-thin,
18
+ .fad,
19
+ .#{$fa-css-prefix}-duotone,
20
+ .fab,
21
+ .#{$fa-css-prefix}-brands {
22
+ -moz-osx-font-smoothing: grayscale;
23
+ -webkit-font-smoothing: antialiased;
24
+ display: var(--#{$fa-css-prefix}-display, #{$fa-display});
25
+ font-style: normal;
26
+ font-variant: normal;
27
+ line-height: 1;
28
+ text-rendering: auto;
29
+ }
30
+
31
+ %fa-icon {
32
+ @include fa-icon;
33
+ }
@@ -0,0 +1,7 @@
1
+ // fixed-width icons
2
+ // -------------------------
3
+
4
+ .#{$fa-css-prefix}-fw {
5
+ text-align: center;
6
+ width: $fa-fw-width;
7
+ }
@@ -0,0 +1,57 @@
1
+ // functions
2
+ // --------------------------
3
+
4
+ // fa-content: convenience function used to set content property
5
+ @function fa-content($fa-var) {
6
+ @return unquote("\"#{ $fa-var }\"");
7
+ }
8
+
9
+ // fa-divide: Originally obtained from the Bootstrap https://github.com/twbs/bootstrap
10
+ //
11
+ // Licensed under: The MIT License (MIT)
12
+ //
13
+ // Copyright (c) 2011-2021 Twitter, Inc.
14
+ // Copyright (c) 2011-2021 The Bootstrap Authors
15
+ //
16
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ // of this software and associated documentation files (the "Software"), to deal
18
+ // in the Software without restriction, including without limitation the rights
19
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ // copies of the Software, and to permit persons to whom the Software is
21
+ // furnished to do so, subject to the following conditions:
22
+ //
23
+ // The above copyright notice and this permission notice shall be included in
24
+ // all copies or substantial portions of the Software.
25
+ //
26
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32
+ // THE SOFTWARE.
33
+
34
+ @function fa-divide($dividend, $divisor, $precision: 10) {
35
+ $sign: if($dividend > 0 and $divisor > 0, 1, -1);
36
+ $dividend: abs($dividend);
37
+ $divisor: abs($divisor);
38
+ $quotient: 0;
39
+ $remainder: $dividend;
40
+ @if $dividend == 0 {
41
+ @return 0;
42
+ }
43
+ @if $divisor == 0 {
44
+ @error "Cannot divide by 0";
45
+ }
46
+ @if $divisor == 1 {
47
+ @return $dividend;
48
+ }
49
+ @while $remainder >= $divisor {
50
+ $quotient: $quotient + 1;
51
+ $remainder: $remainder - $divisor;
52
+ }
53
+ @if $remainder > 0 and $precision > 0 {
54
+ $remainder: fa-divide($remainder * 10, $divisor, $precision - 1) * .1;
55
+ }
56
+ @return ($quotient + $remainder) * $sign;
57
+ }
@@ -0,0 +1,9 @@
1
+ // specific icon class definition
2
+ // -------------------------
3
+
4
+ /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
5
+ readers do not read off random characters that represent icons */
6
+
7
+ @each $name, $icon in $fa-icons {
8
+ .#{$fa-css-prefix}-#{$name}::before { content: unquote("\"#{ $icon }\""); }
9
+ }
@@ -0,0 +1,18 @@
1
+ // icons in a list
2
+ // -------------------------
3
+
4
+ .#{$fa-css-prefix}-ul {
5
+ list-style-type: none;
6
+ margin-left: var(--#{$fa-css-prefix}-li-margin, #{$fa-li-margin});
7
+ padding-left: 0;
8
+
9
+ > li { position: relative; }
10
+ }
11
+
12
+ .#{$fa-css-prefix}-li {
13
+ left: calc(var(--#{$fa-css-prefix}-li-width, #{$fa-li-width}) * -1);
14
+ position: absolute;
15
+ text-align: center;
16
+ width: var(--#{$fa-css-prefix}-li-width, #{$fa-li-width});
17
+ line-height: inherit;
18
+ }
@@ -0,0 +1,73 @@
1
+ // mixins
2
+ // --------------------------
3
+
4
+ // base rendering for an icon
5
+ @mixin fa-icon {
6
+ -webkit-font-smoothing: antialiased;
7
+ -moz-osx-font-smoothing: grayscale;
8
+ display: inline-block;
9
+ font-style: normal;
10
+ font-variant: normal;
11
+ font-weight: normal;
12
+ line-height: 1;
13
+ }
14
+
15
+ // sets relative font-sizing and alignment (in _sizing)
16
+ @mixin fa-size ($font-size) {
17
+ font-size: fa-divide($font-size, $fa-size-scale-base) * 1em; // converts step in sizing scale into an em-based value that's relative to the scale's base
18
+ line-height: fa-divide(1, $font-size) * 1em; // sets the line-height of the icon back to that of it's parent
19
+ vertical-align: (fa-divide(6, $font-size) - fa-divide(3, 8)) * 1em; // vertically centers the icon taking into account the surrounding text's descender
20
+ }
21
+
22
+ // only display content to screen readers
23
+ // see: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
24
+ // see: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
25
+ @mixin fa-sr-only() {
26
+ position: absolute;
27
+ width: 1px;
28
+ height: 1px;
29
+ padding: 0;
30
+ margin: -1px;
31
+ overflow: hidden;
32
+ clip: rect(0, 0, 0, 0);
33
+ white-space: nowrap;
34
+ border-width: 0;
35
+ }
36
+
37
+ // use in conjunction with .sr-only to only display content when it's focused
38
+ @mixin fa-sr-only-focusable() {
39
+ &:not(:focus) {
40
+ @include fa-sr-only();
41
+ }
42
+ }
43
+
44
+ // convenience mixins for declaring pseudo-elements by CSS variable,
45
+ // including all style-specific font properties, and both the ::before
46
+ // and ::after elements in the duotone case.
47
+ @mixin fa-icon-solid($fa-var) {
48
+ @extend %fa-icon;
49
+ @extend .fa-solid;
50
+
51
+ &::before {
52
+ content: unquote("\"#{ $fa-var }\"");
53
+ }
54
+ }
55
+
56
+ @mixin fa-icon-regular($fa-var) {
57
+ @extend %fa-icon;
58
+ @extend .fa-regular;
59
+
60
+ &::before {
61
+ content: unquote("\"#{ $fa-var }\"");
62
+ }
63
+ }
64
+
65
+ @mixin fa-icon-brands($fa-var) {
66
+ @extend %fa-icon;
67
+ @extend .fa-brands;
68
+
69
+ &::before {
70
+ content: unquote("\"#{ $fa-var }\"");
71
+ }
72
+ }
73
+
@@ -0,0 +1,31 @@
1
+ // rotating + flipping icons
2
+ // -------------------------
3
+
4
+ .#{$fa-css-prefix}-rotate-90 {
5
+ transform: rotate(90deg);
6
+ }
7
+
8
+ .#{$fa-css-prefix}-rotate-180 {
9
+ transform: rotate(180deg);
10
+ }
11
+
12
+ .#{$fa-css-prefix}-rotate-270 {
13
+ transform: rotate(270deg);
14
+ }
15
+
16
+ .#{$fa-css-prefix}-flip-horizontal {
17
+ transform: scale(-1, 1);
18
+ }
19
+
20
+ .#{$fa-css-prefix}-flip-vertical {
21
+ transform: scale(1, -1);
22
+ }
23
+
24
+ .#{$fa-css-prefix}-flip-both,
25
+ .#{$fa-css-prefix}-flip-horizontal.#{$fa-css-prefix}-flip-vertical {
26
+ transform: scale(-1, -1);
27
+ }
28
+
29
+ .#{$fa-css-prefix}-rotate-by {
30
+ transform: rotate(var(--#{$fa-css-prefix}-rotate-angle, none));
31
+ }
@@ -0,0 +1,14 @@
1
+ // screen-reader utilities
2
+ // -------------------------
3
+
4
+ // only display content to screen readers
5
+ .sr-only,
6
+ .#{$fa-css-prefix}-sr-only {
7
+ @include fa-sr-only;
8
+ }
9
+
10
+ // use in conjunction with .sr-only to only display content when it's focused
11
+ .sr-only-focusable,
12
+ .#{$fa-css-prefix}-sr-only-focusable {
13
+ @include fa-sr-only-focusable;
14
+ }