
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@toddledev/tailwind-parser
Advanced tools
A lightweight library for parsing Tailwind CSS classes and converting HTML with Tailwind classes to a custom node tree structure.
A lightweight library for parsing Tailwind CSS classes and converting HTML with Tailwind classes to a custom node tree structure.
npm install @toddledev/tailwind-parser
or
yarn add @toddledev/tailwind-parser
import { parseClassString } from '@toddledev/tailwind-parser';
const classString = 'bg-blue-500 hover:bg-blue-600 p-4';
const { style, variants } = parseClassString(classString);
console.log(style); // Object containing parsed styles
console.log(variants); // Array of parsed variants
import { tailwindToToddle } from '@toddledev/tailwind-parser';
const html = '<div class="bg-red-500 p-4"><span class="text-white">Hello, World!</span></div>';
const nodeTree = tailwindToToddle(html);
console.log(nodeTree);
parseClassString(classString: string): { style: Record<string, string>, variants: Variant[] }
Parses a string of Tailwind CSS classes and returns an object containing the parsed styles and variants.
tailwindToToddle(html: string): NodeTree
Converts an HTML string with Tailwind classes to a custom node tree structure.
The library exports the following types:
Variant
NodeTree
ElementNode
TextNode
Contributions are welcome! Please feel free to submit a Pull Request.
If you find any bugs or have feature requests, please create an issue on the GitHub repository.
FAQs
A lightweight library for parsing Tailwind CSS classes and converting HTML with Tailwind classes to a custom node tree structure.
The npm package @toddledev/tailwind-parser receives a total of 17 weekly downloads. As such, @toddledev/tailwind-parser popularity was classified as not popular.
We found that @toddledev/tailwind-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.