Skip to content

fix(preset-icons): support captital letters in className#4149

Merged
zyyv merged 1 commit intounocss:mainfrom
shenjunjian:preset-icon-support-captital
Nov 5, 2024
Merged

fix(preset-icons): support captital letters in className#4149
zyyv merged 1 commit intounocss:mainfrom
shenjunjian:preset-icon-support-captital

Conversation

@shenjunjian
Copy link
Copy Markdown
Contributor

close: #4148

support captital letter in className

@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 20, 2024

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit feed371
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/66ecdde24914740008926d4d
😎 Deploy Preview https://deploy-preview-4149--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 configuration.

@zyyv
Copy link
Copy Markdown
Member

zyyv commented Sep 20, 2024

We keep the lowercase syntax in all regular expressions by default, and why don't you use lowercase syntax anymore?

The capitalized syntax is weird when connected after - and it doesn't follow the camelCase naming convention. The lowercase icon name is consistent with iconify.

@zyyv zyyv closed this Sep 20, 2024
@shenjunjian
Copy link
Copy Markdown
Contributor Author

I don't think so. First of all, the DOM's className supports uppercase characters, so there should be the freedom to use uppercase characters. Secondly, for some technical terms, uppercase characters are necessary, such as ECS, IBM, KFC, Apple, which makes it more intuitive. Thirdly, the SVG materials provided by designers also use uppercase characters, and to maintain consistency, the icons need to use uppercase characters as well.

Isn't it a better choice to gain greater freedom with just a little change?
@zyyv

@shenjunjian
Copy link
Copy Markdown
Contributor Author

“We keep the lowercase syntax in all regular expressions by default”
You can encourage such behavior, but there's no need to restrict it to only such behavior. For example, when browsing the Rust standard library, the style there is not at all in line with JavaScript conventions, yet Rust is still a successful language.

@zyyv
Copy link
Copy Markdown
Member

zyyv commented Sep 22, 2024

Isn't it a better choice to gain greater freedom with just a little change? @zyyv

@shenjunjian I actually don't want to see any breakthroughs in this area, as it would create an update burden, such as flex --> Flex etc... which makes UnoCSS more likely to be extracted, resulting in some invalid utilities.

We get icons from iconify, and I think we should follow the upstream naming conventions.

@autofix-ci
Copy link
Copy Markdown
Contributor

autofix-ci Bot commented Oct 19, 2024

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Oct 19, 2024

Open in Stackblitz

commit: feed371

@zyyv zyyv linked an issue Oct 21, 2024 that may be closed by this pull request
4 tasks
@zyyv zyyv added this pull request to the merge queue Nov 5, 2024
Merged via the queue into unocss:main with commit d7b3622 Nov 5, 2024
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.

presetIcons ignored the file names of icons starting with uppercase letters @unocss/preset-icons does not support class names with capital letters

2 participants