mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
Merge remote-tracking branch 'origin/main' into dev
This commit is contained in:
commit
78a41b55ed
13 files changed
+80
-30
No files matched your search
@@ -343,7 +343,7 @@
|
||||
},
|
||||
"marketing": {
|
||||
"title": "Marketing",
|
||||
"url": "marketing/index.html"
|
||||
"url": "marketing.html"
|
||||
},
|
||||
"music": {
|
||||
"title": "Music",
|
||||
|
||||
@@ -28,9 +28,10 @@ const { title, pageLibs = [], bodyClass, rtl = false, base = '.', description, t
|
||||
// script runs, so a page keeps its variant until the visitor chooses otherwise.
|
||||
const themeAttributes = themeDataAttributes(themeSettings)
|
||||
|
||||
// Development build: unminified assets, dev favicon.
|
||||
const environment = 'development'
|
||||
const min = environment === 'development' ? '' : '.min'
|
||||
// Development build: unminified assets, dev favicon (same rule as DocsLayout).
|
||||
const environment = process.env.NODE_ENV || 'production'
|
||||
const isDevelopment = environment === 'development'
|
||||
const min = isDevelopment ? '' : '.min'
|
||||
// RTL swaps tabler/plugin stylesheets for their .rtl.css variants (demo stays LTR)
|
||||
const rtlSuffix = rtl ? '.rtl' : ''
|
||||
|
||||
@@ -55,8 +56,8 @@ const libJsFiles = (head: boolean) => pageLibEntries.filter(([, lib]) => Boolean
|
||||
<title>{title ? `${title} - ` : ''}{site.title} - {site.descriptionShort}</title>
|
||||
<meta name="description" content={description ?? site.descriptionShort} />
|
||||
|
||||
<link rel="icon" href={`${base}/favicon-dev.ico`} type="image/x-icon" />
|
||||
<link rel="shortcut icon" href={`${base}/favicon-dev.ico`} type="image/x-icon" />
|
||||
<link rel="icon" href={`${base}/favicon${isDevelopment ? '-dev' : ''}.ico`} type="image/x-icon" />
|
||||
<link rel="shortcut icon" href={`${base}/favicon${isDevelopment ? '-dev' : ''}.ico`} type="image/x-icon" />
|
||||
<!-- END META -->
|
||||
|
||||
{
|
||||
|
||||
+7
-2
@@ -24,8 +24,13 @@ const FILLER_PATH = /<path stroke="none" d="M0 0h24v24H0z" fill="none"\s*\/>/
|
||||
* aria-hidden="true" focusable="false" and the given classes.
|
||||
*/
|
||||
export function iconSvg(name: string, { filled = false, classes = 'icon' }: { filled?: boolean | undefined; classes?: string | undefined } = {}): string | undefined {
|
||||
const icon = (icons as unknown as Record<string, IconRecord>)[name]
|
||||
if (!icon) return undefined
|
||||
const icon = (icons as unknown as Record<string, IconRecord | undefined>)[name]
|
||||
if (!icon) {
|
||||
// Icon.astro renders nothing for an unknown name, which is invisible in the
|
||||
// page; say so in the build log instead of failing silently.
|
||||
console.warn(`[svg] unknown Tabler icon "${name}"`)
|
||||
return undefined
|
||||
}
|
||||
let svg = icon.svg?.[filled ? 'filled' : 'outline'] ?? ''
|
||||
svg = svg.replace(FILLER_PATH, '')
|
||||
svg = svg.replace(/class="[^"]+"/, `aria-hidden="true" focusable="false" class="${classes}"`)
|
||||
|
||||
Reference in new issue
Block a user