Update Chinese translation of fornt-end-libraries (#40653)

* Update Chinese translation of fornt-end-libraries

* fix: revert to previous translation

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
This commit is contained in:
ZhichengChen
2021-01-13 00:22:19 +08:00
committed by GitHub
parent 306e4aaacf
commit 797cc3024e
16 changed files with 371 additions and 32 deletions

View File

@@ -31,7 +31,7 @@ div {
}
```
定义以`@mixin`开头,后跟自定义名称。参数(`$x``$y``$blur`,以及上例中的`$c`是可选的。 现在,只要在需要的地方使用`@include`调用上面定义的`mixin`,就可以自动添加好所有的浏览器前缀:`mixin`使用`@include`指令调用:
定义以`@mixin`开头,后跟自定义名称。参数(`$x``$y``$blur`,以及上例中的`$c`是可选的。 现在,只要在需要 `box-shadow` 的地方使用`@include`调用上面定义的`mixin`,就可以自动添加好所有的浏览器前缀:`mixin`使用`@include`指令调用:
```scss
div {
@@ -54,32 +54,78 @@ assert(code.match(/@mixin\s+?border-radius\s*?\(\s*?\$radius\s*?\)\s*?{/gi));
你应该给`$radius`添加`-webkit-border-radius`浏览器前缀。
```js
assert(code.match(/-webkit-border-radius:\s*?\$radius;/gi));
assert(
__helpers.removeWhiteSpace(code).match(/-webkit-border-radius:\$radius;/gi)
);
```
你应该给`$radius`添加`-moz-border-radius`浏览器前缀。
```js
assert(code.match(/-moz-border-radius:\s*?\$radius;/gi));
assert(
__helpers.removeWhiteSpace(code).match(/-moz-border-radius:\$radius;/gi)
);
```
你应该给`$radius`添加`-ms-border-radius`浏览器前缀。
```js
assert(code.match(/-ms-border-radius:\s*?\$radius;/gi));
assert(__helpers.removeWhiteSpace(code).match(/-ms-border-radius:\$radius;/gi));
```
你应该给`$radius`添加`border-radius`
```js
assert(code.match(/border-radius:\s*?\$radius;/gi).length == 4);
assert(
__helpers.removeWhiteSpace(code).match(/border-radius:\$radius;/gi).length ==
4
);
```
你应使用`@include`关键字调用`border-radius mixin`,并将其设置为 15px。
```js
assert(code.match(/@include\s+?border-radius\(\s*?15px\s*?\);/gi));
assert(code.match(/@include\s+?border-radius\(\s*?15px\s*?\)\s*;/gi));
```
# --seed--
## --seed-contents--
```html
<style type='text/scss'>
#awesome {
width: 150px;
height: 150px;
background-color: green;
}
</style>
<div id="awesome"></div>
```
# --solutions--
```html
<style type='text/scss'>
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
#awesome {
width: 150px;
height: 150px;
background-color: green;
@include border-radius(15px);
}
</style>
<div id="awesome"></div>
```