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

feat(preset-mini)!: remove default border-styles on border-x utility #1971

Merged
merged 1 commit into from Dec 21, 2022

Conversation

chu121su12
Copy link
Collaborator

Aligns with tailwind; close #1967.

Reference: https://tailwindcss.com/docs/border-width

@netlify
Copy link

netlify bot commented Dec 6, 2022

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e3f65c4
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/638ef71f83476f0008b531a2
😎 Deploy Preview https://deploy-preview-1971--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@chu121su12 chu121su12 marked this pull request as ready for review December 6, 2022 08:07
@zyyv
Copy link
Member

zyyv commented Dec 6, 2022

Hi, I'd prefer to keep it as it is and make it more flexible isn't it?

:( Too bad my projects are all using b to have a border and now I have to add b-solid for it. 😭

@sibbng
Copy link
Member

sibbng commented Dec 6, 2022

Hi, I'd prefer to keep it as it is and make it more flexible isn't it?

:( Too bad my projects are all using b to have a border and now I have to add b-solid for it. 😭

No, you don't need to. solid is the default.

@chu121su12
Copy link
Collaborator Author

I'd argue without the set style is more flexible.

As for the default, solid style is set in both

*,
::before,
::after {
box-sizing: border-box; /* 1 */
border-width: 0; /* 2 */
border-style: solid; /* 2 */

and

*, ::before, ::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;

@antfu antfu merged commit 2e305f3 into unocss:main Dec 21, 2022
@chu121su12 chu121su12 deleted the feat/border-style branch January 9, 2023 05:19
@ghost
Copy link

ghost commented Jan 13, 2023

Even if adding CSS resets is a solution, there are use cases where one doesn't want to use a reset. For example, in my use-case, I am using unocss as a complementary tool for Naive-UI. Including resets are breaking pretty much everything. There are only 2 options left:

  1. either add b-solid everywhere border is used
  2. add
*,
::before,
::after {
  border-width: 0;
  border-style: solid;
}

to global css file or preflights with getCSS

Now even if the second option is ok, it is probably not very convenient to do when you are using another UI framework. As far as I can see, it is not overlapping with Naive UI, but might be something to consider.

Bernankez added a commit to Bernankez/keke.cc that referenced this pull request Jan 14, 2023
In v0.48.x, unocss removed the default `border-style` in `b`, refer to unocss/unocss#1971
@sibbng
Copy link
Member

sibbng commented Mar 2, 2023

@onur-caplena I posted an alternative solution on #2285 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Losing border style
4 participants