惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
IT之家
IT之家
Y
Y Combinator Blog
T
Tailwind CSS Blog
B
Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
InfoQ
J
Java Code Geeks
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog

The Eleventy Firehose

New Sponsorship Tiers for the Build Awesome Kickstarter Securely Publishing our Packages to npm Back Build Awesome Pro and make it easier to build for the web! The Possum Mascot, now with additional Awesome Build Awesome (11ty) (@11ty.dev) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Build Awesome (11ty) (@11ty.dev) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Build Awesome (11ty) (@11ty.dev) Release Import v1.0.20 · 11ty/import Release Import v1.0.21 · 11ty/import Build Awesome (11ty) (@11ty.dev) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Build Awesome (11ty) (@11ty.dev) Cozy Keyboard Build and Build Awesome AMA Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Build Awesome (11ty) (@11ty.dev) A few demos of Editing and Collaboration in Build Awesome Pro (as always, AMA!) Build Awesome (11ty) (@11ty.dev) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Bluesky: May 6, 2026 at 7:54:00 PM UTC An Awesome Theming Demo with Dave Gandy (and more Build Awesome AMA) Build Awesome (11ty) (@11ty@neighborhood.11ty.dev) Release v8.0.0 · 11ty/eleventy-plugin-vite Build Awesome Pro Kickstarter AMA
Quick Tip: Super Simple CSS Concatenation
Zach Leather · 2026-06-07 · via The Eleventy Firehose

In some situations you may want to concatenate content files together into a single top level template. Maybe you want to create a single CSS file with all of your component CSS inside.

Consider this sample theme.njk file:

---
permalink: theme.css
---

{% include "components/header.css" %}
{% include "components/footer.css" %}

That’s an easy way to concatenate files and control the include order.

You might imagine creating an include-all Shortcode that uses fast-glob to include a glob of files like {% include-all "components/*.css" %}, but that’s an exercise left to the reader!

Capture and Minify

In our Inline CSS Quick Tip, we discussed how to capture and minify a CSS file. This approach can be modified, of course, to capture multiple includes too!

<!-- capture the CSS content as a Nunjucks variable -->
{% set css %}
{% include "components/header.css" %}
{% include "components/footer.css" %}
{% endset %}
<!-- feed it through our cssmin filter to minify -->
<style>
	{{ css | cssmin | safe }}
</style>

Warning about Content Security Policy

WARNING

If you are using a Content Security Policy on your website, make sure the style-src directive allows 'unsafe-inline'. Otherwise, your inline CSS will not load.

Work with what you have

Of course, Eleventy has no desire to replace your existing build pipeline. This is just a super simple example if you want something up and running quickly.

That said, Eleventy wants to work with what you have. As an example, the EleventyOne project scaffold is a fine example of using Eleventy with Gulp and Sass. At time of writing, the zachleat.com source code is an older example that works with Grunt and Sass (not anymore though).