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

Proposal: Create icon package for VanJS #1326

Open
carlosmintfan opened this issue Feb 14, 2025 · 1 comment
Open

Proposal: Create icon package for VanJS #1326

carlosmintfan opened this issue Feb 14, 2025 · 1 comment
Labels
feature request New feature/change requested

Comments

@carlosmintfan
Copy link
Contributor

carlosmintfan commented Feb 14, 2025

VanJS is a very good framework. It would be great to have an integration package for it here. The SVG dom should be converted to VanJS code by https://github.com/vanjs-org/converter.

However, maybe that'd be overkill. Workaround:

// utils.ts
export const stringToSVGElement = (s: string) => {
  const parser = new DOMParser();
  return parser.parseFromString(s, 'image/svg+xml').documentElement;
}
// in other file
import { stringToSVGElement } from './utils.ts';
import IconInfoCircle from '@tabler/icons/icons/outline/info-circle.svg?raw';
import van from "vanjs-core";
const { div } = van.tags; // whatever
div(stringToSVGElement(IconInfoCircle))
@BG-Software-BG BG-Software-BG added the feature request New feature/change requested label Feb 25, 2025
@BG-Software-BG
Copy link
Member

BG-Software-BG commented Feb 25, 2025

We won't plan to add it in the near future but we're open for PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature/change requested
Projects
None yet
Development

No branches or pull requests

2 participants