framework7
Version:
Full featured mobile HTML framework for building iOS & Android apps
96 lines (83 loc) • 2 kB
text/less
/* === Typography === */
.rules-loop(@values, @ruleName) {
.loop(@array, @i: 1) when (@i =< length(@array)) {
@value: extract(@array, @i);
.@{ruleName}-@{value} {
@{ruleName}: @value !important;
}
.loop(@array, (@i + 1));
}
.loop(@values);
}
// Display
@display: flex, block, inline-flex, inline-block, inline, none;
.rules-loop(@display, display);
// Flex Shrink
@shrinks: 0,1,2,3,4,5,6,7,8,9,10;
.rules-loop(@shrinks, flex-shrink);
// Justify Content
@justify: flex-start, center, flex-end, space-between, space-around, space-evenly, stretch, start, end, left, right;
.rules-loop(@justify, justify-content);
// Align Content
@alignContent: flex-start, flex-end, center, space-between, space-around, stretch;
.rules-loop(@alignContent, align-content);
// Align Items
@alignItems: flex-start, flex-end, center, stretch;
.rules-loop(@alignItems, align-items);
// Align Self
@alignSelf: flex-start, flex-end, center, stretch;
.rules-loop(@alignSelf, align-self);
// Text Align
@textAlign: left, center, right, justify;
.rules-loop(@textAlign, text-align);
// Float
@float: left, right, none;
.rules-loop(@float, float);
// Vertical Align
@verticalAlign: bottom, middle, top;
.rules-loop(@verticalAlign, vertical-align);
// Padding
.no-padding {
padding: 0 ;
}
.no-padding-left {
padding-left: 0 ;
}
.no-padding-right {
padding-right: 0 ;
}
.no-padding-top {
padding-top: 0 ;
}
.no-padding-bottom {
padding-bottom: 0 ;
}
// Margin
.no-margin {
margin: 0 ;
}
.no-margin-left {
margin-left: 0 ;
}
.no-margin-right {
margin-right: 0 ;
}
.no-margin-top {
margin-top: 0 ;
}
.no-margin-bottom {
margin-bottom: 0 ;
}
// Width
.width-auto {
width: auto ;
}
.width-100 {
width: 100% ;
}
& when (@includeIosTheme) {
@import url('./typography-ios.less');
}
& when (@includeMdTheme) {
@import url('./typography-md.less');
}