1 / 3

LESS

Explore the power of LESS variables and mixins to streamline your CSS. In this guide, learn to implement color variables like `@color: #4D926F` for consistent theming and apply dynamic styles. Discover how to create reusable mixins for rounded corners with customizable radii for headers and footers, resulting in clean and maintainable code. This approach ensures a modern edge to your web design while optimizing CSS for cross-browser compatibility. Elevate your front-end development skills with efficient styling techniques.

Télécharger la présentation

LESS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LESS - Variables Mixins

  2. Variables // Less @color: #4D926F; #header { color:@color; } h2 { color: @color; } • // css @color: #4D926F; #header { • color:#4D926F; } h2 { • color: #4D926F; }

  3. Mixins /* Compiled CSS */ #header { -webkit-border-radius: 5px; -moz-border-radius: 5px; -ms-border-radius: 5px; -o-border-radius:5px; border-radius:5px; } #footer { -webkit-border-radius: 10px; -moz-border-radius: 10px;-ms-border-radius:10px; -o-border-radius: 10px; border-radius:10px; } // LESS .rounded-corners (@radius: 5px) { -webkit-border-radius:@radius; -moz-border-radius: @radius; -ms-border-radius: @radius; -o-border-radius: @radius; border-radius:@radius; } #header { .rounded-corners; } #footer { .rounded-corners(10px); }

More Related