浏览代码

Remove `Inter` font and use default font system stack (#1048)

Paweł Kuna 3 年之前
父节点
当前提交
1b81926c1d

+ 1 - 11
gulpfile.js

@@ -437,7 +437,6 @@ gulp.task('browser-sync', () => {
 				'/dist/css': `${distDir}/css`,
 				'/dist/css': `${distDir}/css`,
 				'/dist/js': `${distDir}/js`,
 				'/dist/js': `${distDir}/js`,
 				'/dist/img': `${srcDir}/img`,
 				'/dist/img': `${srcDir}/img`,
-				'/dist/fonts': `${srcDir}/fonts`,
 				'/static': `${srcDir}/static`,
 				'/static': `${srcDir}/static`,
 			},
 			},
 		},
 		},
@@ -497,15 +496,6 @@ gulp.task('copy-static', () => {
 		.pipe(gulp.dest(`${demoDir}/static`))
 		.pipe(gulp.dest(`${demoDir}/static`))
 })
 })
 
 
-/**
- * Copy fonts
- */
-gulp.task('copy-fonts', () => {
-	return gulp
-		.src(`${srcDir}/fonts/**/*`)
-		.pipe(gulp.dest(`${distDir}/fonts`))
-})
-
 /**
 /**
  * Copy Tabler dist files to demo directory
  * Copy Tabler dist files to demo directory
  */
  */
@@ -528,6 +518,6 @@ gulp.task('clean', gulp.series('clean-dirs', 'clean-jekyll'))
 
 
 gulp.task('start', gulp.series('clean', 'sass', 'js', 'js-demo', 'mjs', 'build-jekyll', gulp.parallel('watch-jekyll', 'watch', 'browser-sync')))
 gulp.task('start', gulp.series('clean', 'sass', 'js', 'js-demo', 'mjs', 'build-jekyll', gulp.parallel('watch-jekyll', 'watch', 'browser-sync')))
 
 
-gulp.task('build-core', gulp.series('build-on', 'clean', 'sass', 'css-rtl', 'css-minify', 'js', 'js-demo', 'mjs', 'copy-images', 'copy-fonts', 'copy-libs', 'add-banner'))
+gulp.task('build-core', gulp.series('build-on', 'clean', 'sass', 'css-rtl', 'css-minify', 'js', 'js-demo', 'mjs', 'copy-images', 'copy-libs', 'add-banner'))
 gulp.task('build-demo', gulp.series('build-on', 'build-jekyll', 'copy-static', 'copy-dist', 'build-cleanup', 'build-purgecss'/*, 'build-critical'*/))
 gulp.task('build-demo', gulp.series('build-on', 'build-jekyll', 'copy-static', 'copy-dist', 'build-cleanup', 'build-purgecss'/*, 'build-critical'*/))
 gulp.task('build', gulp.series('build-core', 'build-demo'))
 gulp.task('build', gulp.series('build-core', 'build-demo'))

二进制
src/fonts/inter-v7-latin-ext_latin-300.woff


二进制
src/fonts/inter-v7-latin-ext_latin-300.woff2


二进制
src/fonts/inter-v7-latin-ext_latin-500.woff


二进制
src/fonts/inter-v7-latin-ext_latin-500.woff2


二进制
src/fonts/inter-v7-latin-ext_latin-600.woff


二进制
src/fonts/inter-v7-latin-ext_latin-600.woff2


二进制
src/fonts/inter-v7-latin-ext_latin-700.woff


二进制
src/fonts/inter-v7-latin-ext_latin-700.woff2


二进制
src/fonts/inter-v7-latin-ext_latin-regular.woff


二进制
src/fonts/inter-v7-latin-ext_latin-regular.woff2


+ 3 - 0
src/pages/_data/docs.yml

@@ -29,6 +29,9 @@ content:
     icons:
     icons:
       title: Icons
       title: Icons
       url: docs/icons.html
       url: docs/icons.html
+    customize:
+      title: Customize Tabler
+      url: docs/customize.html
 
 
 layout:
 layout:
   title: Layout
   title: Layout

+ 25 - 0
src/pages/_docs/customize.md

@@ -0,0 +1,25 @@
+---
+menu: docs.content.customize
+title: Customize Tabler
+description: Tabler has been designed so that it can be adjusted to your needs and requirements as much as possible. You can customize your own fonts, colors, font sizes, etc in it.
+---
+
+## Custom Google Font
+
+To use a custom Google Fonts font in Tabler you must import the font in the `<head>` section of the page. In this example we will use the _Inter_ font:
+
+```html
+<link rel="preconnect" href="https://fonts.googleapis.com">
+<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
+```
+
+Now you just need to tell Tabler to use your favorite font:
+
+```html
+<style>
+body {
+  --tblr-font-sans-serif: 'Inter';
+}
+</style>
+```

+ 3 - 3
src/scss/_variables.scss

@@ -15,10 +15,10 @@ $assets-base: ".." !default;
 // FONTS
 // FONTS
 $font-google: null !default;
 $font-google: null !default;
 $font-google-monospaced: null !default;
 $font-google-monospaced: null !default;
-$font-local: 'Inter' !default;
+$font-local: null !default;
 $font-icons: () !default;
 $font-icons: () !default;
 
 
-$font-family-sans-serif: unquote("#{if($font-local, "#{$font-local}, ", '')} #{if($font-google, "#{$font-google}, ", '')}") -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif !default;
+$font-family-sans-serif: unquote("#{if($font-local, "#{$font-local}, ", ' ')}#{if($font-google, "#{$font-google}, ", ' ')}")-apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif !default;
 $font-family-monospace: unquote("#{if($font-google-monospaced, "#{$font-google-monospaced}, ", '')}") Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
 $font-family-monospace: unquote("#{if($font-google-monospaced, "#{$font-google-monospaced}, ", '')}") Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
 $font-family-serif: "Georgia", "Times New Roman", times, serif !default;
 $font-family-serif: "Georgia", "Times New Roman", times, serif !default;
 
 
@@ -96,7 +96,7 @@ $gray-700: #334155 !default;
 $gray-800: #1e293b !default;
 $gray-800: #1e293b !default;
 $gray-900: #0f172a !default;
 $gray-900: #0f172a !default;
 
 
-$light: $gray-50 !default;
+$light: #f5f7fb !default;
 $dark: $gray-800 !default;
 $dark: $gray-800 !default;
 
 
 $body-bg: $light !default;
 $body-bg: $light !default;