diff --git a/README.md b/README.md index 31acba3..0d1d831 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,14 @@ The page title is set using the `LINKS_TITLE` environment variable. Set `LINKS_NEW_TAB=true` (or `1`) to open all links in a new browser tab instead of the current tab. +#### Custom CSS + +Set `LINKS_CSS` to inject arbitrary CSS into the page. Useful for tweaking font size, colors, spacing, etc. without rebuilding the bundle. Example: + +``` +LINKS_CSS=":root { font-size: 18px; }" +``` + #### Links Links have a name, URL, icon (optional), and sort index (optional). A link to this repo could be configured in various ways: diff --git a/src/App.svelte b/src/App.svelte index 4c0d373..fd6e84c 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -9,6 +9,12 @@ let links = getLinks(env); let title = env.LINKS_TITLE || 'Links'; let newTab = env.LINKS_NEW_TAB === 'true' || env.LINKS_NEW_TAB === '1'; + + if (env.LINKS_CSS) { + const style = document.createElement('style'); + style.textContent = env.LINKS_CSS; + document.head.appendChild(style); + } let search = ""; let searchElement; let activeElement = null;