Module Description
The Field CSS module provides a field (which can then be added to any entity type) that accepts css, does minimal processing and then adds the css to the entity display.
It provides options to namespace any of the css declarations.
It provides two widgets, one that allows for structured entering of the CSS with the selector and the style in different fields, and a free form widget where all of the css can be entered in one large text area.
This structured approach allows for some validation of the content. The field attempt to stop people from entering CSS in away that would get around a selector prefix by
* Striping :root from the selector
* Parsing on all { } so that every selector gets the prefix
If the library CodeMirror is present then Field CSS also provides syntax highlighting.
It is worth noting that this module is very indebted to the Code Per Node module. Both for some good ideas as well as for the CodeMirror implementation. It has some overlap with this module, the main differences being:
* Code Per Node also does JS
* Field CSS is based on the Drupal Field API and therefor can be add to any entity and works in any paradigm that used the Field API (such as translation or workflow)
* In General Code Per Node is much more mature and has more features.
It provides options to namespace any of the css declarations.
It provides two widgets, one that allows for structured entering of the CSS with the selector and the style in different fields, and a free form widget where all of the css can be entered in one large text area.
This structured approach allows for some validation of the content. The field attempt to stop people from entering CSS in away that would get around a selector prefix by
* Striping :root from the selector
* Parsing on all { } so that every selector gets the prefix
If the library CodeMirror is present then Field CSS also provides syntax highlighting.
It is worth noting that this module is very indebted to the Code Per Node module. Both for some good ideas as well as for the CodeMirror implementation. It has some overlap with this module, the main differences being:
* Code Per Node also does JS
* Field CSS is based on the Drupal Field API and therefor can be add to any entity and works in any paradigm that used the Field API (such as translation or workflow)
* In General Code Per Node is much more mature and has more features.
Module Link
Project Usage
153
Security Covered
Covered By Security Advisory
Version Available
DEV
Module Summary
The Field CSS module aims to provide a structured way for users to add CSS to entity displays, with options for namespace declarations and validation to prevent selector prefix bypassing.
Data Name
field_css