The Node CSS module for Backdrop CMS allows administrators to add custom CSS styles to individual nodes selectively based on content type. This module is perfect for users who want custom styling for specific node types without affecting the entire site.
- Add custom CSS directly to node forms.
- Enable or disable custom CSS for individual content types.
- CSS is added inline to the head of the page, applying only to specific nodes.
- Download and place the
node_css
module in your Backdropmodules
directory, typically found insites/all/modules
. - Go to
Admin > Functionality > Modules
in your Backdrop site. - Enable the Node CSS module.
- Navigate to
Admin > Configuration > Content > Node CSS
to access the settings page. - You will see a list of all content types as checkboxes. Select the content types you want the Node CSS functionality to be active for.
- Save your settings.
- After enabling Node CSS for a content type, go to the node edit form for a node of that type.
- You will see a Custom CSS textarea field at the top of the form.
- Enter your custom CSS for that node, then save the node.
- The CSS will be added inline to the head of the node’s page, applying only to that specific node.
If you want to add a custom background color to a specific node of an enabled content type, add the following CSS to the Custom CSS field:
body {
background-color: red !important;
}
This will apply a red background only to that specific node page.
CSS may not apply as expected if there are conflicting styles or higher specificity from other stylesheets.
Bugs and Feature requests should be reported in the Issue Queue: https://github.com/backdrop-contrib/node_css/issues.
This module is maintained by Alan Mels of AltaGrade.com and is open to contributions. Please feel free to submit issues and feature requests.
This module introduces the CodeMirror CSS editor to enhance the editing experience, allowing custom CSS rules to be added directly on the node edit page. It is designed with simplicity in mind to meet the specific need of per-node CSS customization without the additional complexity of site-wide CSS management. We utilize CodeMirror's syntax highlighting and theme support to provide a more robust and user-friendly CSS editing environment.