ohayolibs
Version:
Ohayo is a set of essential modules for ohayojp.
92 lines (82 loc) • 3.58 kB
text/less
/**
* 白色背景
* White background
*/
.bg-white {
background-color: #fff ;
}
/**
* 透明背景
* Transparent background
*/
.bg-transparent {
background-color: transparent ;
}
/**
* 白色文本
* White text
*/
.text-white {
color: #fff ;
}
/**
* 鼠标悬停文本主颜色
* Mouse hover text primary color
*/
.text-hover {
cursor: pointer;
&:hover {
color: @primary-color ;
}
}
.for-each(@colors, {
.bg-@{adKey}-light { background-color: extract(@adItem, @color-light-position) ; }
.bg-@{adKey} { background-color: extract(@adItem, @color-basic-position) ; }
.bg-@{adKey}-dark { background-color: extract(@adItem, @color-dark-position) ; }
.bg-@{adKey}-light-h { transition: background-color 300ms; &:hover { background-color: extract(@adItem, @color-light-position) ; } }
.bg-@{adKey}-h { transition: background-color 300ms; &:hover { background-color: extract(@adItem, @color-basic-position) ; } }
.bg-@{adKey}-dark-h { transition: background-color 300ms; &:hover { background-color: extract(@adItem, @color-dark-position) ; } }
.text-@{adKey}-light { color: extract(@adItem, @color-light-position) ; }
.text-@{adKey} { color: extract(@adItem, @color-basic-position) ; }
.text-@{adKey}-dark { color: extract(@adItem, @color-dark-position) ; }
});
.for-each(@aliasColors, {
.bg-@{adKey}-light { background-color: ~`getColor('@{colors}', '@{adValue}', @{color-light-position})` ; }
.bg-@{adKey} { background-color: ~`getColor('@{colors}', '@{adValue}', @{color-basic-position})` ; }
.bg-@{adKey}-dark { background-color: ~`getColor('@{colors}', '@{adValue}', @{color-dark-position})` ; }
.bg-@{adKey}-light-h { transition: background-color 300ms; &:hover { background-color: ~`getColor('@{colors}', '@{adValue}', @{color-light-position})` ; } }
.bg-@{adKey}-h { transition: background-color 300ms; &:hover { background-color: ~`getColor('@{colors}', '@{adValue}', @{color-basic-position})` ; } }
.bg-@{adKey}-dark-h { transition: background-color 300ms; &:hover { background-color: ~`getColor('@{colors}', '@{adValue}', @{color-dark-position})` ; } }
.text-@{adKey}-light { color: ~`getColor('@{colors}', '@{adValue}', @{color-light-position})` ; }
.text-@{adKey} { color: ~`getColor('@{colors}', '@{adValue}', @{color-basic-position})` ; }
.text-@{adKey}-dark { color: ~`getColor('@{colors}', '@{adValue}', @{color-dark-position})` ; }
});
// grey
.for-each(@greyColorer, {
.bg-grey-@{adKey} { background-color: @adValue ; }
.bg-grey-@{adKey}-h { &:hover { background-color: @adValue ; } }
.text-grey-@{adKey} { color: @adValue ; }
});
.all-colors-minin(@enabled) when (@enabled = true) {
.loop-no(@adKey, @adValue, @i: 1) when (@i =< length(@color-no-list)) {
// @color-no-list
@name: '@{adKey}-@{i}';
.bg-@{adKey}-@{i} {
background-color: @@name ;
}
.bg-@{adKey}-@{i}-h {
transition: background-color 300ms;
&:hover {
background-color: @@name ;
}
}
.text-@{adKey}-@{i} {
color: @@name ;
}
.loop-no(@adKey, @adValue, @i + 1);
}
.for-each(@colors, {
.loop-no(@adKey, @adValue, 1);
});
}
.all-colors-minin(@enable-all-colors);