Files
lucide/docs/.vitepress/theme/composables/useIconStyle.ts
Eric Fennis 34155d48e7 Site improvements (#1366)
* write cions details

* add details

* Add icons details

* update gitignore

* Add node details

* Move tags api to own composable

* remove overridden var

* remopve whitespace

* log directory existence

* Fix path name

* Fix build

* Fix tags fetching

* Move max related icons to prebuild

* Improve tags scroller

* Add categories call

* cleanup

* Add active state
2023-06-15 14:44:43 +02:00

39 lines
772 B
TypeScript

/* eslint-disable no-console */
import {
ref, inject, Ref
} from 'vue';
export const ICON_STYLE_CONTEXT = Symbol('size');
interface IconSizeContext {
size: Ref<number>
strokeWidth: Ref<number>
color: Ref<string>
absoluteStrokeWidth: Ref<boolean>
}
export const STYLE_DEFAULTS = {
size: 24,
strokeWidth: 2,
color: 'currentColor',
absoluteStrokeWidth: false,
};
export const iconStyleContext = {
size: ref(24),
strokeWidth: ref(2),
color: ref('currentColor'),
absoluteStrokeWidth: ref(false),
};
export function useIconStyleContext(): IconSizeContext{
const context = inject<IconSizeContext>(ICON_STYLE_CONTEXT);
if (!context) {
throw new Error('useIconStyleContext must be used with useIconStyleProvider');
}
return context;
}