Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. douceur

douceur

MITGov0.2.0

A simple CSS parser and inliner library written in Go for processing and embedding styles in HTML.

GitHubGitHub
262 stars46 forks0 contributors

What is douceur?

Douceur is a Go library and command-line tool for parsing CSS and inlining styles into HTML documents. It solves the problem of embedding CSS directly within HTML, which is essential for scenarios like email template generation where external stylesheets are not supported. The library parses CSS into a structured format and applies styles as inline attributes, enhancing compatibility.

Target Audience

Go developers working on email template systems, document processors, or any application requiring CSS manipulation and HTML style embedding. It's also suitable for those needing a lightweight CSS parsing tool in Go.

Value Proposition

Developers choose Douceur for its simplicity, reliability, and focused feature set—it does one thing well without bloat. Its integration with Go's ecosystem and ability to handle real-world CSS quirks make it a practical alternative to more complex solutions.

Overview

A simple CSS parser and inliner in Go

Use Cases

Best For

  • Generating HTML email templates with inline styles
  • Parsing and cleaning CSS in Go applications
  • Converting CSS styles to inline HTML attributes for compatibility
  • Building tools that process or transform HTML documents
  • Embedding CSS from style tags into HTML elements programmatically
  • Command-line CSS file parsing and inspection

Not Ideal For

  • Applications requiring real-time CSS processing in web browsers
  • Projects that depend heavily on external stylesheets from URLs or CDNs
  • Teams needing advanced CSS features like SASS compilation or vendor prefixing
  • Environments where a full-featured, multi-language CSS framework is preferred

Pros & Cons

Pros

Simple and Reliable API

Focuses on straightforward CSS parsing and inlining without bloat, as emphasized in the README's philosophy, making it easy to integrate into Go projects.

Graceful Error Handling

Parser handles comments and malformed CSS gracefully, ensuring robust processing of real-world inputs, demonstrated in the code example with messy CSS.

Enhanced Email Compatibility

Inliner adds equivalent HTML attributes like bgcolor for background-color, improving support for older email clients, as shown in the README example.

Included CLI Tool

Provides a command-line interface for parsing CSS files and inlining HTML documents directly, with simple commands like 'douceur inline input.html'.

Cons

No External Stylesheet Support

Explicitly stated in the README that it does not fetch external stylesheets, limiting use for documents with linked CSS or remote resources.

Dependency on Third-Party Libraries

Relies on Gorilla CSS3 tokenizer and goquery, which can introduce versioning conflicts or increase project dependency complexity.

Limited CSS3 Compliance

Inspired by CSS3 syntax but not fully compliant, potentially missing support for newer CSS features or complex selectors like media queries.

Frequently Asked Questions

Quick Stats

Stars262
Forks46
Contributors0
Open Issues4
Last commit4 years ago
CreatedSince 2015

Tags

#email-templates#goquery#go-library#command-line-tool#css-parser#css-processing#go

Built With

G
Go
g
goquery

Included in

Go169.1k
Auto-fetched 1 day ago

Related Projects

MailHogMailHog

Web and API based SMTP testing

Stars16,194
Forks1,183
Last commit2 years ago
MailpitMailpit

An email and SMTP testing tool with API for developers

Stars10,750
Forks367
Last commit1 day ago
MaddyMaddy

✉️ Composable all-in-one mail server.

Stars6,115
Forks336
Last commit7 days ago
moxmox

modern full-featured open source secure mail server for low-maintenance self-hosted email

Stars5,918
Forks234
Last commit18 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub