Experimental project
This is a sandbox project, which contains experimental code for developer use only.
At least at some point in your career, you will have built a 'Free HTML' content type. This will inevitably be followed by endless support requests and hot fixes for broken layouts. The ever existing craving of content editors to gain control over HTML and CSS haunts Drupal site builders and developers.
Instead of fighting against this recurring feature request, we've listened and tried to find a good solution. This module tries to close the gap between content editors' need to create intricate HTML/CSS layouts and the boundaries set by predefined styles and templates provided by modules and themes.
How this module works.
This module brings 2 new field types to Drupal: CSS inline and JS Inline. Field instances of either type contain custom CSS and JS managed by content editors. Field formatters make sure the code gets formatted correctly. An entity can contain multiple Inline CSS/Inline JS fields applied to various displays.
CSS inliner
The CSS Inliner formatter uses the same strategy as seen in HTML e-mails: CSS is transformed to inline styles attributes applied directly to corresponding classes used in the DOM. We use the CssToInlineStyles class to transform CSS selectors.
The advantage: Client CSS is remains self contained to those displays where the formatter is active and can't break the entire site. However, you'll still be handing over control of those parts page layout where CS Inline fields are applied.
JS inliner
The JS inliner also comes as a field type/formatter. Custom JS, added by content editors, will be included to the footer region (configurable) of your pages.
Project information
- Project categories: Content editing experience, Content display
- Created by netsensei on , updated

