Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/lucide-icons/lucide into lu…
Browse files Browse the repository at this point in the history
…cide-package-aliases
  • Loading branch information
ericfennis committed Oct 9, 2023
2 parents 1f75dc8 + cf9565b commit a9ba1d0
Show file tree
Hide file tree
Showing 137 changed files with 4,143 additions and 1,112 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/lucide-font.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
jobs:
lucide-font:
runs-on: ubuntu-latest
container: ericfennis/lucide-font:latest
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
Expand Down Expand Up @@ -43,11 +42,11 @@ jobs:
- name: Outline svg Icons
run: pnpm build:outline-icons

- name: Create directory
run: mkdir lucide-font
- name: Install dependencies
run: pnpm install --filter build-font

- name: Build font
run: fontcustom compile "./outlined" -h -n "lucide" -o ./lucide-font -F
- name: Create font in ./lucide-font
run: pnpm build:font

- name: "Upload to Artifacts"
uses: actions/upload-artifact@v1
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ Thank you to all the people who contributed to Lucide!

## Sponsors


<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss">
<img src="/docs/public/vercel.svg" alt="Powered by Vercel" width="200" />
<img src="docs/public/vercel.svg" alt="Powered by Vercel" width="200" />
</a>

<a href="https://www.digitalocean.com/?refcode=b0877a2caebd&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge"><img src="docs/public/digitalocean.svg" width="200" alt="DigitalOcean Referral Badge" /></a>
51 changes: 34 additions & 17 deletions docs/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,49 @@ const sidebar: UserConfig<DefaultTheme.Config>['themeConfig']['sidebar'] = {
{ text: 'Comparison', link: '/guide/comparison' }
]
},
{
text: 'Basics',
items: [
{
text: 'Color',
link: '/guide/basics/color'
},
{
text: 'Sizing',
link: '/guide/basics/sizing'
},
{
text: 'Stroke width',
link: '/guide/basics/stroke-width'
},
]
},
// TODO: Add this section
// {
// text: 'Using Icons',
// text: 'Advanced',
// items: [
// {
// text: 'How to use icons',
// link: 'how-to-use-icons'
// text: 'Accessibility',
// link: '/guide/advanced/accessibility'
// },
// {
// text: 'Styling icons',
// link: 'styling-icons'
// text: 'Global styling',
// },
// {
// text: 'Accessibility',
// link: 'accessibility'
// text: 'Animations',
// },
// {
// text: 'What should I use',
// link: 'what-should-i-use'
// text: 'Filled icons',
// },

// {
// text: 'Combining icons',
// },
// {
// text: 'Dynamic imports'
// },
// // {
// // text: 'Auto importing'
// // },
// ]
// },
{
Expand Down Expand Up @@ -103,15 +126,9 @@ const sidebar: UserConfig<DefaultTheme.Config>['themeConfig']['sidebar'] = {
]
},
],
// This should be here to keep the sidebar shown on the icons page
'icons': [
{ text: '', link: '/' },
// { text: 'Categorized', link: '/icons/categorized' },
// {
// text: 'Categories',
// items: [
// ...(getAllCategoryFiles().map((category) => ({ text: category, link: `/icons/category/${category}` })))
// ]
// }
],
}

Expand Down
23 changes: 15 additions & 8 deletions docs/.vitepress/theme/components/overrides/VPFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,22 @@ const links = computed(() => [
<template>
<footer v-if="theme.footer" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
<div class="container">
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>
<div class="sponsors">
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss" rel="noreferrer noopener">
<img src="/vercel.svg" alt="Powered by Vercel" width="200" />
</a>
<a href="https://www.digitalocean.com/?refcode=b0877a2caebd&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge" rel="noreferrer noopener">
<img src="/digitalocean.svg" alt="Digital Ocean" width="200" />
</a>
</div>
<div class="links">
<VPLink v-for="link in links" :href="link.href" :key="link.text" :rel="link.href.startsWith('http') ? 'noreferrer noopener': undefined">
{{ link.text }}
</VPLink>
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss" rel="noreferrer noopener">
<img src="/vercel.svg" alt="Powered by Vercel" width="200" />
</a>
</div>
<div>
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>
</div>
</div>
</footer>
Expand All @@ -67,7 +74,7 @@ const links = computed(() => [
.container {
margin: 0 auto;
max-width: var(--vp-layout-max-width);
max-width: calc(var(--vp-layout-max-width) - 64px);
display: flex;
flex-direction: column;
align-items: center;
Expand All @@ -85,7 +92,7 @@ const links = computed(() => [
.message { order: 2; }
.copyright { order: 1; }
.links {
.links, .sponsors {
display: flex;
gap: 32px;
align-items: center;
Expand All @@ -102,7 +109,7 @@ const links = computed(() => [
flex-direction: row-reverse;
}
.links {
margin-left: auto;
margin-right: auto;
}
}
</style>
34 changes: 34 additions & 0 deletions docs/.vitepress/theme/sandpackTheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"colors": {
"surface1": "var(--vp-code-block-bg)",
"surface2": "var(--vp-code-block-bg)",
"surface3": "var(--vp-code-line-highlight-color)",
"clickable": "var(--vp-c-text-2)",
"base": "#323232",
"disabled": "#C5C5C5",
"hover": "var(--vp-c-brand)",
"accent": "var(--vp-c-brand)",
"error": "var(--vp-c-red)",
"errorSurface": "#ffeceb"
},
"syntax": {
"plain": "var(--vp-code-editor-plain)",
"comment": {
"color": "var(--vp-code-editor-comment)",
"fontStyle": "italic"
},
"keyword": "var(--vp-code-editor-keyword)",
"tag": "var(--vp-code-editor-tag)",
"punctuation": "var(--vp-code-editor-punctuation)",
"definition": "var(--vp-code-editor-definition)",
"property": "var(--vp-code-editor-property)",
"static": "var(--vp-code-editor-static)",
"string": "var(--vp-code-editor-string)"
},
"font": {
"body": "var(--vp-font-family-base)",
"mono": "var(--vp-font-family-mono)",
"size": "var(--vp-code-font-size)",
"lineHeight": "var(--vp-code-line-height)"
}
}
75 changes: 75 additions & 0 deletions docs/.vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,39 @@
--vp-c-brand-dark: #DC5A5A;
--vp-c-brand-darker: #C45050;

--vp-c-brand-1: #F67373;
--vp-c-brand-2: #FF7070;
--vp-c-brand-3: #F56565;
--vp-c-brand-4: #DC5A5A;
--vp-c-brand-5: #C45050;

--vp-c-bg-alt-up: #fff;
--vp-c-bg-alt-down: #fff;

--vp-code-editor-plain: #24292E;
--vp-code-editor-comment: #6A737D;
--vp-code-editor-keyword: #D73A49;
--vp-code-editor-tag: #22863A;
--vp-code-editor-punctuation: #24292E;
--vp-code-editor-definition: #6F42C1;
--vp-code-editor-property: #005CC5;
--vp-code-editor-static: #F78C6C;
--vp-code-editor-string: #032F62;
}

.dark {
--vp-c-bg-alt-up: #1B1B1D;
--vp-c-bg-alt-down: #0F0F10;

--vp-code-editor-plain: #E1E4E8;
--vp-code-editor-comment: #6A737D;
--vp-code-editor-keyword: #F97583;
--vp-code-editor-tag: #85E89D;
--vp-code-editor-punctuation: #9ECBFF;
--vp-code-editor-definition: #B392F0;
--vp-code-editor-property: #79B8FF;
--vp-code-editor-static: #F78C6C;
--vp-code-editor-string: #9ECBFF;
}

.VPNavBarTitle .logo {
Expand Down Expand Up @@ -126,3 +152,52 @@
html:has(* .outline-link:target) {
scroll-behavior: smooth;
} */

.sp-wrapper .sp-layout {
border-radius: 8px;
}

.sp-wrapper .sp-tabs-scrollable-container {
border-radius: 8px 8px 0 0;
position: relative;

box-shadow: inset 0 -1px var(--vp-code-tab-divider);
margin-bottom: 0px;
margin-top: -1px;
height: 48px;
padding-bottom: 1px;
}

.sp-wrapper .sp-preview-container {
background-color: transparent;
}

.sp-wrapper .sp-tabs .sp-tab-button {
padding: 0 12px;
line-height: 48px;
height: 48px;
font-size: 14px;
font-weight: 500;
position: relative;
/* box-sizing: content-box; */
}

.sp-wrapper .sp-tabs .sp-tab-button:after {
position: absolute;
right: 8px;
left: 8px;
bottom: 0px;
z-index: 1;
height: 1px;
content: '';
background-color: transparent;
transition: background-color 0.25s;
}

.sp-wrapper .sp-tabs .sp-tab-button[data-active="true"] {
color: var(--vp-code-tab-active-text-color);
}

.sp-wrapper .sp-tabs .sp-tab-button[data-active="true"]:after {
background-color: var(--vp-code-tab-active-bar-color);
}
4 changes: 4 additions & 0 deletions docs/guide/advanced/accessibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Accessibility

<!-- Description how you should use svg icons keeping web accessible -->
<!-- See @JanTrichter comment about some information to write this: https://github.com/lucide-icons/lucide/pull/1521#discussion_r1332141390 -->
13 changes: 13 additions & 0 deletions docs/guide/advanced/filled-icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Filled Icons

Fills are officially not supported.
However, all SVG properties are available on all icons.
Fill can still be used and will work fine on certain icons.

Example with stars:

<!-- Code Example with stars -->

## Will Lucide have fills in the future?

This feature is requested several times and discussion is happening at: [#458](https://github.com/lucide-icons/lucide/discussions/458).
52 changes: 52 additions & 0 deletions docs/guide/basics/color.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<script setup>
import { Sandpack } from 'sandpack-vue3'
import sandpackTheme from '../../.vitepress/theme/sandpackTheme.json'
import buttonExampleFiles from './examples/button-example/files.ts'
import iconColorExampleFiles from './examples/color-icon/files.ts'
</script>

# Color

By default, all icons have the color value: `currentColor`. This keyword uses the element's computed text `color` value to represent the icon color.

Read more about [ `currentColor` on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentcolor_keyword).

## Adjust the color using the `color` prop

The color can be adjusted by passing the color prop to the element.

<Sandpack
template="react"
:theme="sandpackTheme"
:files="iconColorExampleFiles"
:customSetup='{
dependencies: {
"lucide-react": "latest"
}
}'
:options="{
editorHeight: 295,
editorWidthPercentage: 60,
}"
/>

## Using parent elements text color value

Because the color of lucide icons uses `currentColor`, the color of the icon depends on the computed `color` of the element, or it inherits it from its parent.

For example, if a parent element's color value is `#fff` and one of the children is a lucide icon, the color of the icon will be rendered as `#fff`. This is browser native behavior.

<Sandpack
template="react"
:theme="sandpackTheme"
:files="buttonExampleFiles"
:customSetup='{
dependencies: {
"lucide-react": "latest"
}
}'
:options="{
editorHeight: 320,
editorWidthPercentage: 60,
}"
/>
14 changes: 14 additions & 0 deletions docs/guide/basics/examples/absolute-stroke-width-icon/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { RollerCoaster } from "lucide-react";

function App() {
return (
<div className="app">
<RollerCoaster
size={96}
absoluteStrokeWidth={true}
/>
</div>
);
}

export default App;
15 changes: 15 additions & 0 deletions docs/guide/basics/examples/absolute-stroke-width-icon/files.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import App from './App.js?raw'
import styles from '../styles.css?raw'

const files = {
'App.js': {
code: App,
active: true,
},
'styles.css': {
code:styles,
hidden: true
},
}

export default files
Loading

0 comments on commit a9ba1d0

Please sign in to comment.