Compare commits

..

5 commits

Author SHA1 Message Date
Eric Fennis
339c6daad3
Merge branch 'main' into icon/motion 2026-11-20 14:38:14 +01:00
Eric Fennis
784d8353f3
Adust svg 2026-11-20 14:37:58 +01:00
Eric Fennis
3ade533e0e
Apply suggestion from @github-actions[bot]
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-13 14:13:08 +01:00
Eric
a206cfbc36 Remove transportation category 2026-11-13 14:11:08 +01:00
Eric
611f98d3a5 Add circle-speed-lines icon 2026-11-13 13:49:55 +01:00
12 changed files with 71 additions and 60 deletions

View file

@ -0,0 +1,31 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"ericfennis"
],
"use-cases": [
"Indicating fast or instant actions in app interfaces",
"Representing a moving object in motion graphics",
"Showing animation or transition settings in design tools",
"Marking express shipping options in checkout flows"
],
"tags": [
"fast",
"quick",
"motion",
"movement",
"moving",
"velocity",
"animation",
"express",
"acceleration",
"rapid",
"swift",
"racing",
"momentum",
"motion blur"
],
"categories": [
"design"
]
}

View file

@ -0,0 +1,16 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6 12H2" />
<path d="M7.338 17 L4 17" />
<path d="M7.338 7 L3.5 7" />
<circle cx="16" cy="12" r="6" />
</svg>

After

Width:  |  Height:  |  Size: 328 B

View file

@ -18,7 +18,7 @@ export interface LucideConfig {
* Stroke width
* @default 2
*/
strokeWidth: string | number;
strokeWidth: number;
/**
* Whether to use absolute stroke width.
* @deprecated Use `nonScalingStroke` instead.

View file

@ -2,9 +2,9 @@ import { createContext, h, type ComponentChildren } from 'preact';
import { useContext, useMemo } from 'preact/hooks';
const LucideContext = createContext<{
size?: number | string;
size?: number;
color?: string;
strokeWidth?: number | string;
strokeWidth?: number;
/**
* @deprecated Use `nonScalingStroke` instead.
*/
@ -22,9 +22,9 @@ const LucideContext = createContext<{
interface LucideProviderProps {
children: ComponentChildren;
size?: number | string;
size?: number;
color?: string;
strokeWidth?: number | string;
strokeWidth?: number;
/**
* @deprecated Use `nonScalingStroke` instead.
*/

View file

@ -1,9 +1,9 @@
import { createContext, createElement, type ReactNode, useContext, useMemo } from 'react';
const LucideContext = createContext<{
size?: number | string;
size?: number;
color?: string;
strokeWidth?: number | string;
strokeWidth?: number;
/**
* @deprecated Use `nonScalingStroke` instead.
*/
@ -21,9 +21,9 @@ const LucideContext = createContext<{
interface LucideProviderProps {
children: ReactNode;
size?: number | string;
size?: number;
color?: string;
strokeWidth?: number | string;
strokeWidth?: number;
/**
* @deprecated Use `nonScalingStroke` instead.
*/

View file

@ -4,9 +4,9 @@ import { createContext, createElement, type ReactNode, useContext, useMemo } fro
import { LucideProps } from './types';
type LucideConfig = {
size: number | string;
size: number;
color: string;
strokeWidth: number | string;
strokeWidth: number;
/**
* @deprecated Use `nonScalingStroke` instead.
*/

View file

@ -1,9 +1,9 @@
import { createContext, splitProps, type JSXElement } from 'solid-js';
export const LucideContext = createContext<{
size?: number | string;
size?: number;
color?: string;
strokeWidth?: number | string;
strokeWidth?: number;
/**
* @deprecated Use `nonScalingStroke` instead.
*/
@ -21,9 +21,9 @@ export const LucideContext = createContext<{
interface LucideProviderProps {
children: JSXElement;
size?: number | string;
size?: number;
color?: string;
strokeWidth?: number | string;
strokeWidth?: number;
/**
* @deprecated Use `nonScalingStroke` instead.
*/

View file

@ -30,18 +30,11 @@ function buildLucideIconNode(icon: LucideIconData, params: LucideBuildParams = {
? mergeClasses(...classNamesFromClassName)
: mergeClasses('lucide', ...iconClassNames, ...classNamesFromClassName);
let calculatedStrokeWidth = params.strokeWidth ?? defaultAttributes['stroke-width'];
if (params.absoluteStrokeWidth) {
const scaled =
(Number(calculatedStrokeWidth) *
const calculatedStrokeWidth = params.absoluteStrokeWidth
? (Number(params.strokeWidth ?? defaultAttributes['stroke-width']) *
Number(icon.size ?? icon.width ?? defaultAttributes['width'])) /
Number(params.size ?? params.width ?? defaultAttributes['width']);
// Only numeric lengths can be scaled; a CSS unit such as `1em`, or a size of `0`, makes the
// conversion non-finite, so the unscaled width stands rather than emitting `NaN`.
if (Number.isFinite(scaled)) calculatedStrokeWidth = scaled;
}
Number(params.size ?? params.width ?? defaultAttributes['width'])
: (params.strokeWidth ?? defaultAttributes['stroke-width']);
const attributes = {
...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {

View file

@ -1,29 +0,0 @@
import { describe, it, expect } from 'vitest';
import buildLucideIconNode from '../src/build/buildLucideIconNode';
const icon = { name: 'circle', size: 24, node: [] };
const strokeWidthOf = (params: Parameters<typeof buildLucideIconNode>[1]) =>
buildLucideIconNode(icon, params)[1]['stroke-width'];
describe('buildLucideIconNode absoluteStrokeWidth', () => {
it('scales the stroke width for numeric sizes', () => {
expect(strokeWidthOf({ absoluteStrokeWidth: true, strokeWidth: 2, size: 48 })).toBe(1);
});
it('falls back to the unscaled width for a CSS unit size', () => {
expect(strokeWidthOf({ absoluteStrokeWidth: true, strokeWidth: 2, size: '1em' })).toBe(2);
});
it('falls back to the unscaled width for a non-numeric stroke width', () => {
expect(strokeWidthOf({ absoluteStrokeWidth: true, strokeWidth: '1em', size: 48 })).toBe('1em');
});
it('falls back to the unscaled width for a zero size', () => {
expect(strokeWidthOf({ absoluteStrokeWidth: true, strokeWidth: 2, size: 0 })).toBe(2);
});
it('leaves the stroke width alone when not absolute', () => {
expect(strokeWidthOf({ strokeWidth: 2, size: 48 })).toBe(2);
});
});

View file

@ -4,8 +4,8 @@ const LucideContext = Symbol('lucide-context');
export interface LucideGlobalContext {
color?: string;
size?: number | string;
strokeWidth?: number | string;
size?: number;
strokeWidth?: number;
/**
* @deprecated Use `nonScalingStroke` instead.
*/

View file

@ -3,9 +3,9 @@ import { provide, inject } from 'vue';
export const LUCIDE_CONTEXT = Symbol('lucide-icons');
interface LucideIconsContext {
size?: number | string;
size?: number;
color?: string;
strokeWidth?: number | string;
strokeWidth?: number;
/**
* @deprecated Use `nonScalingStroke` instead.
*/

View file

@ -5,7 +5,7 @@ import type {
} from '@lucide/shared/types';
export interface LucideProps extends Partial<SVGAttributes> {
size?: 24 | number | string;
size?: 24 | number;
strokeWidth?: number | string;
/**
* @deprecated Use `nonScalingStroke` instead.