Flexbox Mixin
How do I make an flexbox mixin?
This is the first mixin i have ever written. I wrote it because i often find myself setting display: flex on children of parent with that same attribute set, which feels very repetitive.. What is a flexbox mixin? How do you make a flexbox mixin? This script and codes were developed by Joost Jansen on 19 November 2022, Saturday.
Flexbox Mixin - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Flexbox Mixin</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="wrapper"> <div class="col"> <h2>Test header</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> <div class="col"> <h2>Test header</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> <div class="col"> <h2>Test header</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> <div class="col"> <h2>Test header</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> <div class="col"> <h2>Test header</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div>
</div>
</body>
</html>
Flexbox Mixin - Script Codes CSS Codes
html, body { height: 100%; width: 100%;
}
.wrapper { width: 100%; display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-flow: row wrap; flex-flow: row wrap; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -ms-flex-line-pack: center; align-content: center; -webkit-box-pack: flex-start; -ms-flex-pack: flex-start; justify-content: flex-start;
}
.col { -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; -ms-flex-negative: 1; flex-shrink: 1; -ms-flex-preferred-size: auto; flex-basis: auto; -webkit-align-self: center; -ms-flex-item-align: center; -ms-grid-row-align: center; align-self: center; margin: 10px; width: 33.33%;
}
Developer | Joost Jansen |
Username | DevItWithDavid |
Uploaded | November 19, 2022 |
Rating | 3 |
Size | 2,746 Kb |
Views | 10,120 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
React CSSTransitionGroup | 5,296 Kb |
Firebase Logo Animation | 2,830 Kb |
A Pen by Joost Jansen | 4,394 Kb |
Flexbox Layout - One page website | 5,649 Kb |
League of Legends Login UI | 6,748 Kb |
Flexbox is AWESOME | 2,524 Kb |
Star Wars Battlefront I 2016 Interface | 6,229 Kb |
DevWars Objectives Template | 3,646 Kb |
Perspective Flipbook | 3,627 Kb |
Overwatch cards, three styles | 4,047 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Gradients | Karpovsystems | 2,394 Kb |
Page Transitions in Backbone | Mikefowler | 3,691 Kb |
Add This API | ThatGuySam | 2,848 Kb |
Commuter Line Tokyu 8500 | Pedox | 7,031 Kb |
Birthday Party Starter | Aussieyang | 1,629 Kb |
Mario | Takaneichinose | 3,902 Kb |
Sass Radar | Jlong | 6,887 Kb |
Update CSS Variables with JS | Wesbos | 2,335 Kb |
Faces SVG animation | ScavengerFrontend | 2,957 Kb |
CSS Variables | Jdsteinbach | 4,759 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!