Ich kann die Überschrift der Medienabfrage nicht als Interpolation verwenden. Bei der Verwendung wie folgt wird ein Fehler ausgegeben
$token-screen-md: "@media only screen and (min-width: 48rem)";
#{$token-screen-md} {
display: table-row;
min-width: 100%;
}
Könnte mir bitte jemand helfen, das zu lösen?
"Modulerstellung fehlgeschlagen (aus./node_modules/sass-loader/dist/cjs.js): SassError: erwarteter Selektor. @media only screen and (min-width: 48rem){"
Lösung des Problems
$mobile: "only screen and (max-width: 767px)";
$tablet: "only screen and (min-width: 768px)";
$desktop: "only screen and (min-width: 1025px)";
@media #{$mobile} {
/* my styles for mobile displays */
}`
Entnommen aus Wie zielen Sie mit SASS-Interpolation auf zwei Medienabfragen ab?
Keine Kommentare:
Kommentar veröffentlichen