[Tailwind] Extending Tailwind with Responsive Custom Utility Classes
with Custom classes Utility Responsive
2023-09-14 09:00:50 时间
You are able to extend the custom css with hover, focus, group-hover, responsive variants class in tailwind.
https://tailwindcss.com/docs/functions-and-directives/#variants
<section> <div> <h2 class="banana hover:chocolate"> some text here </h2> </div> </section>
@variants hover, focus { .banana { color: yellow; } .chocolate { color: brown; } }
Tailwind will generate css for you:
.banana { color: yellow; } .chocolate { color: brown; } .focus\:banana:focus { color: yellow; } .focus\:chocolate:focus { color: brown; } .hover\:banana:hover { color: yellow; } .hover\:chocolate:hover { color: brown; }
相关文章
- [AWS] CloudFormation: create EC2 with SecurityGroupIds for custom VPC
- [React] Cleaning up Functional Components with Custom Hooks
- [React] Reduce Code Redundancy with Custom React Hooks
- [Angular] Angular Custom Change Detection with ChangeDetectorRef
- [Tools] Support VS Code Navigation and Autocomplete Based on Webpack Aliases with jsconfig.json
- [Vue @Component] Pass Props Between Components with Vue Slot Scope & renderless component
- [Tailwind] Extending Tailwind with Responsive Custom Utility Classes
- [HTML 5] Styling with ARIA
- [D3] Animate with the General Update Pattern in D3 v4
- [SCSS] Write Custom Functions with the SCSS @function Directive
- [Angular 2] Filter items with a custom search Pipe in Angular 2
- [React] Cleaning up Functional Components with Custom Hooks
- [ngx-formly] Implement a custom form validator with Angular Formly
- [TypeScript] Custom data structures in TypeScript with iterators
- [RxJS] Chain RxJS Operators Together with a Custom `pipe` Function using Array.reduce
- [Jest] Write data driven tests in Jest with test.each
- [Angular] Protect The Session Id with https and http only
- [Angular Directive] Implement Structural Directive Data Binding with Context in Angular
- 【目标检测】61、Dynamic Head Unifying Object Detection Heads with Attentions
- error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
- LVGL 8.2.0之Faded area line chart with custom division lines