Skip to content

docs(cn): translate posts/v22.md #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 50 additions & 50 deletions posts/v22.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# WindiCSS v2.2 is here
# WindiCSS v2.2 现已推出 {#windicss-v2-2-is-here}

This is a summary version that summarizes the improvements and added features from v2.1 to v2.2.
这是一个小版本更新,更新了从 v2.1 v2.2 的改进和添加的特性。

## Features
## 特性 {#features}

- New plugin [scroll-snap](https://windicss.org/plugins/official/scroll-snap.html)
- 新插件 [scroll-snap](https://cn.windicss.org/plugins/official/scroll-snap.html)

- Support Config File When using CLI
- 使用 CLI 时支持配置文件

- Support Exclude Config
- 支持排除配置

> This feature is very useful when you want the same strict mode as tailwind or when you want to block a utility.
> 当你希望使用与 tailwind 相同的严格模式或希望排除一个工具类时,该特性非常有用。
>
> ```js
> // tailwind.config.js
Expand All @@ -22,24 +22,24 @@ This is a summary version that summarizes the improvements and added features fr
> },
> exclude: [
> ...twEclude,
> /^first-letter:/, // diable first-letter variant
> /^first-letter:/, // 禁用 first-letter 可变修饰
> ],
> }
> ```
>
> Using the above configuration, utilities like `bg-hex-1c1c1e p-4.2 m-3.33px` will not be compiled into css. You can block any utility you don't want to use by using regular expressions.
> 使用上面的配置,如 `bg-hex-1c1c1e p-4.2 m-3.33px` 这些工具类将不会被编译成 css。你可以通过使用正则表达式来排除任何不想使用的工具类。

- Support Important Utility
- 支持 important 工具类

> Now we support using ! symbol to mark important style.
> 现在我们支持使用 ! 来标记 important 样式。
>
> ```html
> <div class="!text-green-300 !hover:(p-4 bg-red-500)">
> ...
> </div>
> ```
>
> Will be compiled as
> 将被编译成
>
> ```css
> .\!text-green-300 {
Expand All @@ -55,9 +55,9 @@ This is a summary version that summarizes the improvements and added features fr
> }
> ```

- Support Shortcuts Config
- 支持 shortcuts 配置

> We have also added a shortcuts config to help you quickly add utilities. With this feature, you can even share inline components.
> 我们还添加了一个 shortcuts 配置,以帮助你快速添加工具类。使用该特性,甚至可以共享内联组件。
>
> ```js
> // tailwind.config.js
Expand All @@ -72,7 +72,7 @@ This is a summary version that summarizes the improvements and added features fr
> }
> ```
>
> css-in-js syntax is also supported for complex utility
> 复杂的工具类也同样支持 css-in-js 语法
>
> ```js
> // tailwind.config.js
Expand All @@ -94,38 +94,38 @@ This is a summary version that summarizes the improvements and added features fr
> }
> ```
>
> The utility added by this configuration can also be directly wrapped with variant, such as `sm:btn` . The function of this feature is similar to `@apply`, it will merge all utilities into one style.

- Add support for raw and min/max in custom screen definitions

- Add `handleIgnored` Option

- Add `resolveStaticUtilities` & `resolveDynamicUtilities` interface

- Change `Processor(path) -> Processor(require(resolve(path)))` for browser support

## Bug Fixes

- Fix lost placeholder preflight
- Fix set explicit opacity value on placeholder pseudo-element
- Fix add boxShadow base styles
- Fix ring utility
- Fix add fontFamily with array
- Fix non-class styles add by addUtilities or addComponents disappears.
- Fix missing aspect-ratio pseudo class
- Fix --tw-ring-opacity is missing
- Fix Images base styles are recommended to follow Tailwind itself
- Fix long color name doesn’t works
- Fix plugin config extend not works
- Fix keyframes should not be wrap with variants
- Fix container should not be divided
- Fix keyframes should render before animation
- Fix leading should render after text
- Fix deep nest colors
- Fix CLI can't scan only files in a subfolder on Windows
- Fix user theme should replace default theme
- Fix gridTemplateColumns generation
- Fix custom fontSizes as String and lineHeight as second array item misbehave
- Fix custom animations not working
- Fix images are not working
- Code format and workflow improvement
> 通过此配置项添加的工具类,同样可以直接用可变修饰进行包装,比如 `sm:btn`。这个特性的功能与 `@apply` 指令很类似,它将把所有的工具类合并为一个样式。

- 在自定义屏幕定义中添加对 raw min/max 的支持

- 添加 `handleIgnored` 选项

- 添加 `resolveStaticUtilities` `resolveDynamicUtilities` 接口

- 为浏览器支持更改 `Processor(path) -> Processor(require(resolve(path)))`

## Bug 修复 {#bug-fixes}

- 修复丢失的占位符预检样式
- 修复占位符伪元素上设置显式不透明度的问题
- 修复添加 boxShadow 基础样式
- 修复 ring 工具类
- 修复使用数组添加 fontFamily
- 修复通过 addUtilities addComponents 添加的无 class 样式消失问题
- 修复缺少纵横比伪类
- 修复缺少 --tw-ring-opacity
- 修复图片基础样式建议遵循 Tailwind
- 修复长颜色名称无效
- 修复插件配置扩展无效
- 修复 keyframes 不应该被可变修饰包装
- 修复 container 不应该分开
- 修复 keyframes 应该在 animation 之前渲染
- 修复 leading 应该在 text 之后渲染
- 修复深层嵌套颜色
- 修复 CLI 无法在 Windows 上仅扫描子文件夹中的文件
- 修复用户主题应该替换默认主题
- 修复 gridTemplateColumns 的生成
- 修复自定义字符串样式的 fontSize 和作为数组第二项的 lineHeight 时的问题
- 修复自定义动画无效
- 修复图片无效
- 代码格式和工作流程改进