-
Notifications
You must be signed in to change notification settings - Fork 0
minifyCSS
Reuben L. Lillie edited this page Jul 22, 2019
·
4 revisions
The minifyCSS()
filter optimizes and loads a CSS file inline.
Code resides in filters/minify-css.js
where there is more technical inline documentation.
To use minifyCSS()
, make sure you install Jakub Pawlowicz’s clean-css
module.
~$ npm install --save-dev clean-css
Call this.minifyCSS()
wherever you can load an inline stylesheet.
// layout.11ty.js
module.exports = function (data) {
return `
<!DOCTYPE html>
<html>
<head>
<style>
${this.minifyCSS(this.fileToString('/includes/assets/css/inline.css'))}
</style>
</head>
<body>
…
</body>
</html>
`
}
Copyright © 2019 by Pittsburgh District Church of the Nazarene
- Welcome
- Setup
- Coding Standards
-
HTML (in
/pghnaz.org/wiki
) -
CSS (in
/pghnaz.org/wiki
) -
JavaScript (in
/pghnaz.org/wiki
)
-
HTML (in
- Color Scheme
- Style Guide
- Layouts
404.11ty.js
base.11ty.js
calendar.11ty.js
contact.11ty.js
content.11ty.js
collection.11ty.js
eventList.11ty.js
map.11ty.js
search.11ty.js
- Filters
- Shortcodes
- Site Information
affiliateLogo()
copyrightNotice()
favicon()
rootDomainLogo()
siteLogo()
siteTagline()
- Document metadata
descriptionMeta()
contentDate()
contentTitle()
externalCSS()
headTag()
inlineCSS()
socialMeta()
titleTag()
- Navigation
menu()
socialLinks()
- Headers
contentHeader()
siteHeader()
- Footers
contentFooter()
siteFooter()
- Call to Action
callToAction()
editThisPage()
subscribeToNewsletter()
- Site Information
- Client-Side JavaScript
search.js
- Other static assets
- Badges
- Branding
- Fonts