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

chore(grid-line): add a built-in style of [background-repeat: repeat;] #6580

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

TZZack
Copy link
Contributor

@TZZack TZZack commented Nov 29, 2024

background

Some component library has a global reset-style of background-repeat: no-repeat; and it will cause the grid-line plugin cannot work correct.
image

So the grid-line plugin relies on the background-repeat: repeat;, and we should make it a built-in style in grid-line

@Aarebecca
Copy link
Contributor

更通用的方式或许是给 grid 添加一个 style 属性,然后将该属性解构到 element style ? 这样就可以适应大多数场景了

@TZZack
Copy link
Contributor Author

TZZack commented Dec 6, 2024

更通用的方式或许是给 grid 添加一个 style 属性,然后将该属性解构到 element style ? 这样就可以适应大多数场景了

主要解决的场景不一样,提供style是为了方便配置样式,但也可以通过css直接覆盖,就还好,毕竟是个dom
这里的改动主要是防止background-repeat这个比较核心的属性被全局覆盖成no-repeat后,导致grid-line显示异常,排查起来又比较浪费时间(其实想了下,这个PR感觉可合可不合)

不合的影响

1、在配置了全局样式background-repeat: no-repeat;的项目里,grid-line插件会显示异常,给开发者带来额外的排查时间

影响范围

1、目前我所在公司的组件库有个reset.css,里面就有* {background-repeat:no-repeat;},基本覆盖到80%以上的项目;
2、主流组件库,比如element-plus、element-ui、ant-design-ui等都没有自带这个no-repeat的样式覆盖

@Aarebecca Aarebecca merged commit 756bd64 into antvis:v5 Dec 6, 2024
1 check passed
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.

3 participants