diff --git a/src/core/directives/format-text.ts b/src/core/directives/format-text.ts index 0baf46f0185..80355890d3e 100644 --- a/src/core/directives/format-text.ts +++ b/src/core/directives/format-text.ts @@ -465,7 +465,6 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec const videos = Array.from(div.querySelectorAll('video')); const iframes = Array.from(div.querySelectorAll('iframe')); const buttons = Array.from(div.querySelectorAll('.button')); - const icons = Array.from(div.querySelectorAll('i.fa,i.fas,i.far,i.fab')); const elementsWithInlineStyles = Array.from(div.querySelectorAll('*[style]')); const stopClicksElements = Array.from(div.querySelectorAll('button,input,select,textarea')); const frames = Array.from( @@ -546,6 +545,7 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec }); // Handle Font Awesome icons to be rendered by the app. + const icons = Array.from(div.querySelectorAll('.fa,.fas,.far,.fab,.fa-solid,.fa-regular,.fa-brands')); icons.forEach((icon) => { CoreIcons.replaceCSSIcon(icon); }); diff --git a/src/core/features/course/tests/behat/communication.feature b/src/core/features/course/tests/behat/communication.feature index cbfe8c954ba..4f7c6e1a4b1 100644 --- a/src/core/features/course/tests/behat/communication.feature +++ b/src/core/features/course/tests/behat/communication.feature @@ -2,7 +2,8 @@ Feature: Use custom communication link in course Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | | student1 | Student | 1 | student1@example.com | diff --git a/src/core/singletons/icons.ts b/src/core/singletons/icons.ts index 20860b0c4d4..2a49c7c2811 100644 --- a/src/core/singletons/icons.ts +++ b/src/core/singletons/icons.ts @@ -112,9 +112,20 @@ export class CoreIcons { return; } - const firstPart = faPart[1].split('-')[0]; + const afterFa = faPart[1]; - switch (firstPart) { + const specialClasses = ['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', 'fw', 'sharp', 'rotate', + '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x', + 'flip-horizontal', 'flip-vertical', 'flip-both', 'spin', 'pulse', 'inverse', + 'border', 'pull-left', 'pull-right', 'fixed-width', 'list-item', 'bordered', 'spinning', + 'stack', 'stack-1x', 'stack-2x', 'inverse', 'sr-only', 'sr-only-focusable', 'border']; + + // Class is defining special cases. + if (afterFa && specialClasses.includes(afterFa)) { + return; + } + + switch (afterFa) { // Class is defining library. case 'solid': library = 'solid'; @@ -126,20 +137,9 @@ export class CoreIcons { case 'brands': library = 'brands'; break; - // Class is defining special cases. - case '2xs': - case 'xs': - case 'sm': - case 'lg': - case 'xl': - case '2xl': - case 'fw': - case 'sharp': - case 'rotate': - return; // Class is defining the icon name (fa-ICONNAME). default: - iconName = faPart[1]; + iconName = afterFa; break; } }); diff --git a/src/core/tests/behat/fontawesome.feature b/src/core/tests/behat/fontawesome.feature new file mode 100644 index 00000000000..1be41da6eb3 --- /dev/null +++ b/src/core/tests/behat/fontawesome.feature @@ -0,0 +1,21 @@ +@core @app @javascript +Feature: Fontawesome icons are correctly shown in the app + + Background: + Given the Moodle site is compatible with this feature + And the following "users" exist: + | username | + | student1 | + And the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + And the following "activities" exist: + | activity | idnumber | course | name | intro | printlastmodified | content | + | page | page | C1 | Page | - | false | | + + Scenario: View fontawesome icons in the app + Given I entered the page activity "Page" on course "Course 1" as "student1" in the app + Then the UI should match the snapshot diff --git a/src/core/tests/behat/snapshots/fontawesome-icons-are-correctly-shown-in-the-app-view-fontawesome-icons-in-the-app_7.png b/src/core/tests/behat/snapshots/fontawesome-icons-are-correctly-shown-in-the-app-view-fontawesome-icons-in-the-app_7.png new file mode 100644 index 00000000000..cb5a0fbb2d4 Binary files /dev/null and b/src/core/tests/behat/snapshots/fontawesome-icons-are-correctly-shown-in-the-app-view-fontawesome-icons-in-the-app_7.png differ diff --git a/src/theme/components/ion-icon.scss b/src/theme/components/ion-icon.scss new file mode 100644 index 00000000000..3abb464553e --- /dev/null +++ b/src/theme/components/ion-icon.scss @@ -0,0 +1,685 @@ +// Ionic icon. +ion-icon { + position: relative; + + &.icon-slash::after, + &.icon-backslash::after { + content: " "; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: var(--danger); + -webkit-mask: url("/assets/fonts/font-awesome/solid/slash.svg") no-repeat 50% 50%; + mask: url("/assets/fonts/font-awesome/solid/slash.svg") no-repeat 50% 50%; + } + + &.icon-slash::after { + -webkit-transform: scale(-1, 1); + transform: scale(-1, 1); + } +} + +// The following code is part of the Fontawesome css file that can be found +// https://github.com/FortAwesome/Font-Awesome/blob/6.x/css/fontawesome.css + +/*! + * Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2023 Fonticons, Inc. + */ +core-format-text ion-icon { + &.fa, + &.fa-classic, + &.fa-sharp, + &.fas, + &.fa-solid, + &.far, + &.fa-regular, + &.fab, + &.fa-brands { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + display: var(--fa-display, inline-block); + font-style: normal; + font-variant: normal; + line-height: 1; + text-rendering: auto; + } + + &.fa-1x { + font-size: 1em; + } + + &.fa-2x { + font-size: 2em; + } + + &.fa-3x { + font-size: 3em; + } + + &.fa-4x { + font-size: 4em; + } + + &.fa-5x { + font-size: 5em; + } + + &.fa-6x { + font-size: 6em; + } + + &.fa-7x { + font-size: 7em; + } + + &.fa-8x { + font-size: 8em; + } + + &.fa-9x { + font-size: 9em; + } + + &.fa-10x { + font-size: 10em; + } + + &.fa-2xs { + font-size: 0.625em; + line-height: 0.1em; + vertical-align: 0.225em; + } + + &.fa-xs { + font-size: 0.75em; + line-height: 0.08333em; + vertical-align: 0.125em; + } + + &.fa-sm { + font-size: 0.875em; + line-height: 0.07143em; + vertical-align: 0.05357em; + } + + &.fa-lg { + font-size: 1.25em; + line-height: 0.05em; + vertical-align: -0.075em; + } + + &.fa-xl { + font-size: 1.5em; + line-height: 0.04167em; + vertical-align: -0.125em; + } + + &.fa-2xl { + font-size: 2em; + line-height: 0.03125em; + vertical-align: -0.1875em; + } + + &.fa-fw { + text-align: center; + width: 1.25em; + } + + &.fa-ul { + list-style-type: none; + margin-left: var(--fa-li-margin, 2.5em); + padding-left: 0; + } + + &.fa-ul>li { + position: relative; + } + + &.fa-li { + left: calc(var(--fa-li-width, 2em) * -1); + position: absolute; + text-align: center; + width: var(--fa-li-width, 2em); + line-height: inherit; + } + + &.fa-border { + border-color: var(--fa-border-color, #eee); + border-radius: var(--fa-border-radius, 0.1em); + border-style: var(--fa-border-style, solid); + border-width: var(--fa-border-width, 0.08em); + padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); + } + + &.fa-pull-left { + float: left; + margin-right: var(--fa-pull-margin, 0.3em); + } + + &.fa-pull-right { + float: right; + margin-left: var(--fa-pull-margin, 0.3em); + } + + &.fa-beat { + -webkit-animation-name: fa-beat; + animation-name: fa-beat; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-timing-function: var(--fa-animation-timing, ease-in-out); + } + + &.fa-bounce { + -webkit-animation-name: fa-bounce; + animation-name: fa-bounce; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); + } + + &.fa-fade { + -webkit-animation-name: fa-fade; + animation-name: fa-fade; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + } + + &.fa-beat-fade { + -webkit-animation-name: fa-beat-fade; + animation-name: fa-beat-fade; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + } + + &.fa-flip { + -webkit-animation-name: fa-flip; + animation-name: fa-flip; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-timing-function: var(--fa-animation-timing, ease-in-out); + } + + &.fa-shake { + -webkit-animation-name: fa-shake; + animation-name: fa-shake; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, linear); + animation-timing-function: var(--fa-animation-timing, linear); + } + + &.fa-spin { + -webkit-animation-name: fa-spin; + animation-name: fa-spin; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 2s); + animation-duration: var(--fa-animation-duration, 2s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, linear); + animation-timing-function: var(--fa-animation-timing, linear); + } + + &.fa-spin-reverse { + --fa-animation-direction: reverse; + } + + &.fa-pulse, + &.fa-spin-pulse { + -webkit-animation-name: fa-spin; + animation-name: fa-spin; + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, steps(8)); + animation-timing-function: var(--fa-animation-timing, steps(8)); + } + + @media (prefers-reduced-motion: reduce) { + &.fa-beat, + &.fa-bounce, + &.fa-fade, + &.fa-beat-fade, + &.fa-flip, + &.fa-pulse, + &.fa-shake, + &.fa-spin, + &.fa-spin-pulse { + -webkit-animation-delay: -1ms; + animation-delay: -1ms; + -webkit-animation-duration: 1ms; + animation-duration: 1ms; + -webkit-animation-iteration-count: 1; + animation-iteration-count: 1; + -webkit-transition-delay: 0s; + transition-delay: 0s; + -webkit-transition-duration: 0s; + transition-duration: 0s; + } + } + + @-webkit-keyframes fa-beat { + 0%, + 90% { + -webkit-transform: scale(1); + transform: scale(1); + } + + 45% { + -webkit-transform: scale(var(--fa-beat-scale, 1.25)); + transform: scale(var(--fa-beat-scale, 1.25)); + } + } + + @keyframes fa-beat { + 0%, + 90% { + -webkit-transform: scale(1); + transform: scale(1); + } + + 45% { + -webkit-transform: scale(var(--fa-beat-scale, 1.25)); + transform: scale(var(--fa-beat-scale, 1.25)); + } + } + + @-webkit-keyframes fa-bounce { + 0% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + + 10% { + -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + } + + 30% { + -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + } + + 50% { + -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + } + + 57% { + -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + } + + 64% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + + 100% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + } + + @keyframes fa-bounce { + 0% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + + 10% { + -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + } + + 30% { + -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + } + + 50% { + -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + } + + 57% { + -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + } + + 64% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + + 100% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + } + + @-webkit-keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); + } + } + + @keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); + } + } + + @-webkit-keyframes fa-beat-fade { + 0%, + 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + -webkit-transform: scale(1); + transform: scale(1); + } + + 50% { + opacity: 1; + -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); + transform: scale(var(--fa-beat-fade-scale, 1.125)); + } + } + + @keyframes fa-beat-fade { + 0%, + 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + -webkit-transform: scale(1); + transform: scale(1); + } + + 50% { + opacity: 1; + -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); + transform: scale(var(--fa-beat-fade-scale, 1.125)); + } + } + + @-webkit-keyframes fa-flip { + 50% { + -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + } + } + + @keyframes fa-flip { + 50% { + -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + } + } + + @-webkit-keyframes fa-shake { + 0% { + -webkit-transform: rotate(-15deg); + transform: rotate(-15deg); + } + + 4% { + -webkit-transform: rotate(15deg); + transform: rotate(15deg); + } + + 8%, + 24% { + -webkit-transform: rotate(-18deg); + transform: rotate(-18deg); + } + + 12%, + 28% { + -webkit-transform: rotate(18deg); + transform: rotate(18deg); + } + + 16% { + -webkit-transform: rotate(-22deg); + transform: rotate(-22deg); + } + + 20% { + -webkit-transform: rotate(22deg); + transform: rotate(22deg); + } + + 32% { + -webkit-transform: rotate(-12deg); + transform: rotate(-12deg); + } + + 36% { + -webkit-transform: rotate(12deg); + transform: rotate(12deg); + } + + 40%, + 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + } + + @keyframes fa-shake { + 0% { + -webkit-transform: rotate(-15deg); + transform: rotate(-15deg); + } + + 4% { + -webkit-transform: rotate(15deg); + transform: rotate(15deg); + } + + 8%, + 24% { + -webkit-transform: rotate(-18deg); + transform: rotate(-18deg); + } + + 12%, + 28% { + -webkit-transform: rotate(18deg); + transform: rotate(18deg); + } + + 16% { + -webkit-transform: rotate(-22deg); + transform: rotate(-22deg); + } + + 20% { + -webkit-transform: rotate(22deg); + transform: rotate(22deg); + } + + 32% { + -webkit-transform: rotate(-12deg); + transform: rotate(-12deg); + } + + 36% { + -webkit-transform: rotate(12deg); + transform: rotate(12deg); + } + + 40%, + 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + } + + @-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + } + + @keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + } + + &.fa-rotate-90 { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); + } + + &.fa-rotate-180 { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); + } + + &.fa-rotate-270 { + -webkit-transform: rotate(270deg); + transform: rotate(270deg); + } + + &.fa-flip-horizontal { + -webkit-transform: scale(-1, 1); + transform: scale(-1, 1); + } + + &.fa-flip-vertical { + -webkit-transform: scale(1, -1); + transform: scale(1, -1); + } + + &.fa-flip-both, + &.fa-flip-horizontal.fa-flip-vertical { + -webkit-transform: scale(-1, -1); + transform: scale(-1, -1); + } + + &.fa-rotate-by { + -webkit-transform: rotate(var(--fa-rotate-angle, none)); + transform: rotate(var(--fa-rotate-angle, none)); + } + + &.fa-stack { + display: inline-block; + height: 2em; + line-height: 2em; + position: relative; + vertical-align: middle; + width: 2.5em; + } + + &.fa-stack-1x, + &.fa-stack-2x { + left: 0; + position: absolute; + text-align: center; + width: 100%; + z-index: var(--fa-stack-z-index, auto); + } + + &.fa-stack-1x { + line-height: inherit; + } + + &.fa-stack-2x { + font-size: 2em; + } + + &.fa-inverse { + color: var(--fa-inverse, #fff); + } + + &.sr-only, + &.fa-sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; + } + + &.sr-only-focusable:not(:focus), + &.fa-sr-only-focusable:not(:focus) { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; + } +} diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss index a1543e5b221..6dfd9ac36b6 100644 --- a/src/theme/theme.base.scss +++ b/src/theme/theme.base.scss @@ -258,34 +258,6 @@ ion-footer { } } -// Ionic icon. -ion-icon { - position: relative; - - &.icon-slash::after, - &.icon-backslash::after { - content: " "; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - background-color: var(--danger); - -webkit-mask: url("/assets/fonts/font-awesome/solid/slash.svg") no-repeat 50% 50%; - mask: url("/assets/fonts/font-awesome/solid/slash.svg") no-repeat 50% 50%; - } - - &.icon-slash::after { - -webkit-transform: scale(-1, 1); - transform: scale(-1, 1); - } - - &.fa-fw { - text-align: center; - width: 1.25em; - } -} - // Buttons. ion-button, ion-fab-button, diff --git a/src/theme/theme.scss b/src/theme/theme.scss index 8ef6caa86e7..34177698918 100644 --- a/src/theme/theme.scss +++ b/src/theme/theme.scss @@ -25,6 +25,7 @@ @import "components/format-text.scss"; @import "components/rubrics.scss"; @import "components/mod-label.scss"; +@import "components/ion-icon.scss"; @import "../core/components/error-info/error-info.scss"; @import "components/videojs.scss";