Skip to content

Commit

Permalink
🎨 replace Texta with Work Sans font
Browse files Browse the repository at this point in the history
🍹 fix gulp watch for gulp 4
🐞 fix leftover ' in highlight code block
πŸ“ remove top-banner
πŸ“ v4
  • Loading branch information
desandro committed Dec 30, 2020
1 parent 6bbf9aa commit 11f7ac3
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 59 deletions.
4 changes: 2 additions & 2 deletions content/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ description: New! JavaScript and jQuery plugin to automatically add next pages.
<p>Link directly to Infinite Scroll files on <a href="https://unpkg.com/">unpkg</a>.</p>

``` html
<script src="https://unpkg.com/infinite-scroll@3/dist/infinite-scroll.pkgd.min.js"></script>
<script src="https://unpkg.com/infinite-scroll@4/dist/infinite-scroll.pkgd.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/infinite-scroll@3/dist/infinite-scroll.pkgd.js"></script>
<script src="https://unpkg.com/infinite-scroll@4/dist/infinite-scroll.pkgd.js"></script>
```

{{! ----------------------------------------------------------------- }}
Expand Down
10 changes: 4 additions & 6 deletions css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
}

body {
font-family: 'Texta', sans-serif;
font-family: 'Work Sans', -apple-system, Helvetica, Arial, sans-serif;
color: #444;
line-height: 1.5;
margin: 0;
padding: 0;
}

.export body { font-family: sans-serif; }
.export body { font-family: -apple-system, Helvetica, Arial, sans-serif; }

/* font size on html for rem */
html { font-size: 17px; }
html.export { font-size: 15px; }
html { font-size: 15px; }

a {
color: #19F;
Expand Down Expand Up @@ -153,8 +152,7 @@ tr:nth-child(2) td {

@media screen and (min-width: 768px) {

html { font-size: 19px; }
html.export { font-size: 16px; }
html { font-size: 17px; }

.container {
padding: 0 30px;
Expand Down
36 changes: 13 additions & 23 deletions css/web-fonts.css
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
/* web fonts
------------------------- */

@import url("//hello.myfonts.net/count/2d333f");

/*
Just use WOFF2 and WOFF for webfonts
https://css-tricks.com/snippets/css/using-font-face/ */

/* Texta Heavy */
/* Work Sans Regular */
@font-face {
font-family: 'Texta';
font-weight: bold;
font-family: 'Work Sans';
font-weight: 400;
font-style: normal;
src:
url('../fonts/2D333F_0_0.woff2') format('woff2'),
url('../fonts/2D333F_0_0.woff') format('woff');
src: url('../fonts/WorkSans-Regular.woff2') format('woff2');
}

/* Texta Italic */
/* Work Sans Italic */
@font-face {
font-family: 'Texta';
font-weight: normal;
font-family: 'Work Sans';
font-weight: 400;
font-style: italic;
src:
url('../fonts/2D333F_1_0.woff2') format('woff2'),
url('../fonts/2D333F_1_0.woff') format('woff');
src: url('../fonts/WorkSans-Italic.woff2') format('woff2');
}

/* Texta Regular */
/* Work Sans Semi-bold */
@font-face {
font-family: 'Texta';
src:
url('../fonts/2D333F_2_0.woff2') format('woff2'),
url('../fonts/2D333F_2_0.woff') format('woff');
font-family: 'Work Sans';
font-weight: 600;
font-style: normal;
src: url('../fonts/WorkSans-SemiBold.woff2') format('woff2');
}
13 changes: 2 additions & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@ let site = {
// templating data
data: {
productName: 'Infinite Scroll',
majorVersion: 3,
majorVersion: 4,
isDev: taskName == 'dev',
isExport: taskName == 'export',
},
// src to watch, tasks to trigger
watches: [],
watch: function( src, tasks ) {
site.watches.push([ src, tasks ]);
},
};

// ----- tasks ----- //
Expand Down Expand Up @@ -55,8 +50,4 @@ gulp.task( 'dev', gulp.parallel(
'dist',
'prod-assets',
'content',
), function() {
site.watches.forEach( function( watchable ) {
gulp.watch( ...watchable );
} );
} );
) );
6 changes: 0 additions & 6 deletions modules/site-nav/site-nav.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<div class="top-banner">
<div class="container">
This is the archived documentation site for Infinite Scroll v3. <a href="https://infinite-scroll.com">For the latest version, view infinite-scroll.com</a>.
</div>
</div>

<ol class="site-nav">
<li class="site-nav__item site-nav__item--homepage">
<a href="{{@file.rootPath}}.">Infinite Scroll v3</a>
Expand Down
5 changes: 0 additions & 5 deletions modules/top-banner/top-banner.css

This file was deleted.

15 changes: 10 additions & 5 deletions tasks/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let helpers = {

module.exports = function( site ) {

gulp.task( 'content', function() {
gulp.task( 'buildContent', function() {
// exclude 404 if export
let filterQuery = site.data.isExport ? [ '**', '!**/404.*' ] : '**';

Expand Down Expand Up @@ -70,9 +70,14 @@ module.exports = function( site ) {
.pipe( gulp.dest('build') );
} );

site.watch( contentSrc, [ 'content' ] );
site.watch( pageTemplateSrc, [ 'content' ] );
site.watch( dataSrc, [ 'content' ] );
site.watch( partialsSrc, [ 'content' ] );
let contentTask = gulp.parallel('buildContent');
gulp.task( 'content', contentTask );

if ( site.data.isDev ) {
gulp.watch( contentSrc, contentTask );
gulp.watch( pageTemplateSrc, contentTask );
gulp.watch( dataSrc, contentTask );
gulp.watch( partialsSrc, contentTask );
}

};
2 changes: 1 addition & 1 deletion tasks/utils/highlight-code-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function replaceCodeBlock( match, leadingWhiteSpace, block ) {
block;
// wrap in <pre><code>
let classAttr = language ? `class="${language}"` : '';
return `\n<pre><code ${classAttr}>${highlighted}</code></pre>'`;
return `\n<pre><code ${classAttr}>${highlighted}</code></pre>`;
}

module.exports = function() {
Expand Down

0 comments on commit 11f7ac3

Please sign in to comment.