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(preset-icons): support icon name contains _ #2482

Merged
merged 4 commits into from
Apr 10, 2023
Merged

fix(preset-icons): support icon name contains _ #2482

merged 4 commits into from
Apr 10, 2023

Conversation

mokeyish
Copy link
Contributor

@mokeyish mokeyish commented Apr 10, 2023

Icon names that contain underscores cannot be recognized. such as i-xx-a_b.

@netlify
Copy link

netlify bot commented Apr 10, 2023

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2036b22
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/643419d823e1170008cf7f93
😎 Deploy Preview https://deploy-preview-2482--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.

@mokeyish mokeyish changed the title Support image name contains _ Support icon name contains _ Apr 10, 2023
@antfu antfu changed the title Support icon name contains _ fix(icons): support icon name contains _ Apr 10, 2023
@antfu antfu changed the title fix(icons): support icon name contains _ fix(preset-icons): support icon name contains _ Apr 10, 2023
@antfu antfu enabled auto-merge (squash) April 10, 2023 13:41
auto-merge was automatically disabled April 10, 2023 14:14

Head branch was pushed to by a user without write access

@antfu antfu merged commit 21b7d50 into unocss:main Apr 10, 2023
9 checks passed
@mokeyish
Copy link
Contributor Author

The latest version i-gitlab-svgs-status_running displays black circle. How to fix this?

图片

          <i class="i-gitlab-svgs-template"></i>
          <i class="i-gitlab-svgs-status_running"></i>
  • status_running
  • status_notfound

The configuration:

presetIcons({
        cdn: 'https://esm.sh/',
        warn: true,
        extraProperties: {
          display: 'inline-block'
        },
        collections: {
          'gitlab-svgs': async (name: string) => {
            // preview https://gitlab-org.gitlab.io/gitlab-svgs/
            return $fetch(`https://cdn.jsdelivr.net/gh/mokeyish/gitlab-svgs-o@v3.3.0/icons/sprite_icons/${name}.svg`, { responseType: 'text' });
          }
        }
      })

@mokeyish
Copy link
Contributor Author

It seems conflict with status_.

图片

@mokeyish
Copy link
Contributor Author

@antfu @userquin Hi, do you have any ideas to solve the issue above?

@userquin
Copy link
Member

@mokeyish try render it without color: i-gitlab-svgs-status_running?bg; I guess the svg is wrong, using fill="currentColor"

playground

@mokeyish
Copy link
Contributor Author

@mokeyish try render it without color: i-gitlab-svgs-status_running?bg; I guess the svg is wrong, using fill="currentColor"

playground

Thank you very much. It solved.

@mokeyish mokeyish deleted the patch-1 branch April 12, 2023 13:05
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.

None yet

3 participants