From bc3bb56c46120fb7de0756c519c3939160976465 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Thu, 26 Oct 2017 14:10:13 +0800 Subject: [PATCH 1/2] Add support for pre.-wrap --- _sass/2017/markdown/code.scss | 4 ++++ cheatsheet-styles.md | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/_sass/2017/markdown/code.scss b/_sass/2017/markdown/code.scss index 8b68bb859..cfb1e363f 100644 --- a/_sass/2017/markdown/code.scss +++ b/_sass/2017/markdown/code.scss @@ -34,6 +34,10 @@ line-height: $code-line-height; } + pre.-wrap { + white-space: pre-wrap; + } + pre > code { color: $base-head; max-height: auto; diff --git a/cheatsheet-styles.md b/cheatsheet-styles.md index 4ce7b8a21..4c432a750 100644 --- a/cheatsheet-styles.md +++ b/cheatsheet-styles.md @@ -45,8 +45,9 @@ See: [Tables](#tables-1) ### Code -| `-setup` | Gray background | | `-box-chars` | Less line height
_for box drawing chars_ | +| `-setup` | Gray background | +| `-wrap` | Enables line-wrapping | See: [Code](#code-1) @@ -197,6 +198,15 @@ function createNode(nodeName: string, options: { key: string }) { Long lines will have scrollbars. +### Line wrapping + +```js + +``` +{: .-wrap} + +Add `-wrap` to wrap long lines. + ## Lists {: .-three-column} From 50e4932ef4f065a777b6629c90db56310f89dd57 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Thu, 26 Oct 2017 14:10:20 +0800 Subject: [PATCH 2/2] Add polyfill.io cheatsheet --- polyfill.io.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 polyfill.io.md diff --git a/polyfill.io.md b/polyfill.io.md new file mode 100644 index 000000000..41081ee6e --- /dev/null +++ b/polyfill.io.md @@ -0,0 +1,53 @@ +--- +title: Polyfill.io +category: JavaScript libraries +updated: 2017-10-26 +layout: 2017/sheet +intro: | + [Polyfill.io](https://polyfill.io) is a service that serves JavaScript polyfills. +--- + +## Usage + +### Default usage + +```html + +``` +{: .-wrap} + +This is the default script for Polyfill.io. + +### References + +- [API example](https://polyfill.io/v2/docs/api) _(polyfill.io)_ +- [List of features](https://polyfill.io/v2/docs/features) _(polyfill.io)_ + +## Optimized + +### For modern browsers + +```html + +``` + +This only includes polyfill.io when necessary, skipping it for modern browsers for faster load times. + +### Extra features + +```html + +``` +{: data-line="2,4"} + +This is the same as the previous, but also adds a polyfill for `window.fetch()`. We add a `window.fetch` check and loads the additional `fetch` feature.