Skip to content

Commit

Permalink
Remove Inter font and use default font system stack (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
codecalm committed Feb 19, 2022
1 parent 25568ba commit 1b81926
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 14 deletions.
12 changes: 1 addition & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ gulp.task('browser-sync', () => {
'/dist/css': `${distDir}/css`,
'/dist/js': `${distDir}/js`,
'/dist/img': `${srcDir}/img`,
'/dist/fonts': `${srcDir}/fonts`,
'/static': `${srcDir}/static`,
},
},
Expand Down Expand Up @@ -497,15 +496,6 @@ gulp.task('copy-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
*/
Expand All @@ -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('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', gulp.series('build-core', 'build-demo'))
Binary file removed src/fonts/inter-v7-latin-ext_latin-300.woff
Binary file not shown.
Binary file removed src/fonts/inter-v7-latin-ext_latin-300.woff2
Binary file not shown.
Binary file removed src/fonts/inter-v7-latin-ext_latin-500.woff
Binary file not shown.
Binary file removed src/fonts/inter-v7-latin-ext_latin-500.woff2
Binary file not shown.
Binary file removed src/fonts/inter-v7-latin-ext_latin-600.woff
Binary file not shown.
Binary file removed src/fonts/inter-v7-latin-ext_latin-600.woff2
Binary file not shown.
Binary file removed src/fonts/inter-v7-latin-ext_latin-700.woff
Binary file not shown.
Binary file removed src/fonts/inter-v7-latin-ext_latin-700.woff2
Binary file not shown.
Binary file removed src/fonts/inter-v7-latin-ext_latin-regular.woff
Binary file not shown.
Binary file removed src/fonts/inter-v7-latin-ext_latin-regular.woff2
Binary file not shown.
3 changes: 3 additions & 0 deletions src/pages/_data/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ content:
icons:
title: Icons
url: docs/icons.html
customize:
title: Customize Tabler
url: docs/customize.html

layout:
title: Layout
Expand Down
25 changes: 25 additions & 0 deletions src/pages/_docs/customize.md
Original file line number Diff line number Diff line change
@@ -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>
```
6 changes: 3 additions & 3 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ $assets-base: ".." !default;
// FONTS
$font-google: null !default;
$font-google-monospaced: null !default;
$font-local: 'Inter' !default;
$font-local: null !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-serif: "Georgia", "Times New Roman", times, serif !default;

Expand Down Expand Up @@ -96,7 +96,7 @@ $gray-700: #334155 !default;
$gray-800: #1e293b !default;
$gray-900: #0f172a !default;

$light: $gray-50 !default;
$light: #f5f7fb !default;
$dark: $gray-800 !default;

$body-bg: $light !default;
Expand Down

0 comments on commit 1b81926

Please sign in to comment.