{ "uuid": [ { "value": "68735c24-e65b-47f6-9c23-e1be5123f6a6" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T09:00:50+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "Tailwind CSS' extensibility is one of its best features\n" } ], "created": [ { "value": "2023-01-03T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:50+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2023\/01\/03\/tailwind-css-extensibility-is-one-of-its-best-features", "langcode": "en" } ], "body": [ { "value": "\n
As well as the library of utility CSS classes that Tailwind provides, the ability to easily add your own has been one of my main advantages of using it.<\/p>\n\n
You can add your own CSS to a stylesheet within a specific layer, customise the theme settings within a Here is a complete plugin that I've added to some projects recently:<\/p>\n\n By adding these lines of JavaScript, Tailwind will generate a new set of utility classes that apply styles to both hover and focus states for an element - reducing the number of classes that need to be added and making it more maintainable.<\/p>\n\n Other plugins that I've written recently include creating different variants of buttons, styling elements within an HTML table (similar to the Tailwind typography plugin), and adding multi-theme support to make components themable with different colours.<\/p>\n\ntailwind.config.js<\/code> file, and write your own custom plugins that you can reuse and even release as separate open-source projects.<\/p>\n\n
const plugin = require('tailwindcss\/plugin');\n\nplugin(function({ addVariant }) {\n addVariant('hocus', ['&:hover', '&:focus'])\n});\n<\/code><\/pre>\n\n