Feat(curriculum): scss not sass (#38764)

This commit is contained in:
Oliver Eyton-Williams
2020-05-09 16:31:18 +02:00
committed by GitHub
parent b017ce192c
commit 5e56a9a938
9 changed files with 21 additions and 19 deletions

View File

@ -177,7 +177,9 @@ function getBabelOptions({ preview = false, protect = true }) {
const sassWorker = createWorker(sassCompile);
async function transformSASS(element) {
const styleTags = element.querySelectorAll('style[type="text/sass"]');
// we only teach scss syntax, not sass. Also the compiler does not seem to be
// able to deal with sass.
const styleTags = element.querySelectorAll('style[type~="text/scss"]');
await Promise.all(
[].map.call(styleTags, async style => {
style.type = 'text/css';

View File

@ -60,7 +60,7 @@ tests:
<div id='html-seed'>
```html
<style type='text/sass'>
<style type='text/scss'>
@ -81,7 +81,7 @@ tests:
<section id='solution'>
```html
<style type='text/sass'>
<style type='text/scss'>
$x: 1;
@while $x < 6 {
.text-#{$x}{

View File

@ -75,7 +75,7 @@ tests:
<div id='html-seed'>
```html
<style type='text/sass'>
<style type='text/scss'>
@ -101,7 +101,7 @@ tests:
<section id='solution'>
```html
<style type='text/sass'>
<style type='text/scss'>
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;

View File

@ -58,7 +58,7 @@ tests:
<div id='html-seed'>
```html
<style type='text/sass'>
<style type='text/scss'>
h3{
text-align: center;
}
@ -92,7 +92,7 @@ tests:
<section id='solution'>
```html
<style type='text/sass'>
<style type='text/scss'>
h3{
text-align: center;
}

View File

@ -66,7 +66,7 @@ tests:
<div id='html-seed'>
```html
<style type='text/sass'>
<style type='text/scss'>
.blog-post {
}
@ -95,7 +95,7 @@ tests:
<section id='solution'>
```html
<style type='text/sass'>
<style type='text/scss'>
.blog-post {
h1 {
text-align: center;

View File

@ -54,7 +54,7 @@ tests:
<div id='html-seed'>
```html
<style type='text/sass'>
<style type='text/scss'>
.header{
@ -90,7 +90,7 @@ tests:
<section id='solution'>
```html
<style type='text/sass'>
<style type='text/scss'>
$text-color: red;
.header{

View File

@ -77,7 +77,7 @@ tests:
<div id='html-seed'>
```html
<style type='text/sass'>
<style type='text/scss'>
@ -104,7 +104,7 @@ The solution requires using the $color variable twice: once for the class name a
### List Data type
```html
<style type='text/sass'>
<style type='text/scss'>
@each $color in blue, black, red {
.#{$color}-bg {background-color: $color;}
@ -124,7 +124,7 @@ The solution requires using the $color variable twice: once for the class name a
### Map Data type
```html
<style type='text/sass'>
<style type='text/scss'>
$colors: (color1: blue, color2: black, color3: red);

View File

@ -72,7 +72,7 @@ tests:
<div id='html-seed'>
```html
<style type='text/sass'>
<style type='text/scss'>
@ -95,7 +95,7 @@ tests:
<section id='solution'>
```html
<style type='text/sass'>
<style type='text/scss'>
@for $i from 1 through 5 {
.text-#{$i} { font-size: 15px * $i; }
@ -111,7 +111,7 @@ tests:
```
```html
<style type='text/sass'>
<style type='text/scss'>
@for $i from 1 to 6 {
.text-#{$i} { font-size: 15px * $i; }

View File

@ -77,7 +77,7 @@ tests:
<div id='html-seed'>
```html
<style type='text/sass'>
<style type='text/scss'>
@ -102,7 +102,7 @@ tests:
<section id='solution'>
```html
<style type='text/sass'>
<style type='text/scss'>
@mixin border-stroke($val) {
@if $val == light {
border: 1px solid black;