Skip to content
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

fix. gradient check wrong when has more than one right bracket #518

Merged
merged 4 commits into from
Jul 21, 2021

Conversation

tylorvan
Copy link

Closes #511

原因:针对渐变校验计算规则错误,对于有多个右括号的校验无法命中,导致渐变无法渲染,示例
linear-gradient(to right, rgba(35, 35, 35, 0.8), rgba(35, 35, 35, 0.1))
修复:改为校验最后一个右括号作为完整校验

image

Copy link
Member

@answershuto answershuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需增加用例

@tylorvan
Copy link
Author

需增加用例

已添加用例

answershuto
answershuto previously approved these changes Jul 20, 2021
@@ -30,6 +30,23 @@ describe('linear-gradient', () => {

await snapshot();
});

it('3', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用例的标题建议描述得具体些,不要用无意义的数字

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已添加用例描述

@@ -30,6 +30,23 @@ describe('linear-gradient', () => {

await snapshot();
});

it('3 linear-gradient with many right brackets', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 去掉

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更新

@answershuto answershuto merged commit b092948 into main Jul 21, 2021
@answershuto answershuto deleted the fix/linear-gradient-wrong branch July 21, 2021 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linear-gradient 不支持 rgba 类型 color
3 participants