weui
Version:
A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.
702 lines (646 loc) • 14.2 kB
text/less
/* reset */
/* stylelint-disable */
@import "../style/base/theme/fn";
html,
body {
height: 100%;
-webkit-tap-highlight-color: transparent;
}
body {
font-family: system-ui, -apple-system, "Helvetica Neue", sans-serif;
}
ul {
list-style: none;
}
body,
.page {
background-color: var(--weui-BG-0);
}
.page {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
box-sizing: border-box;
opacity: 0;
z-index: 1; // fix 滑动几次后可滚动区域会卡住的问题
&.js_show {
opacity: 1;
}
&.actionsheet,
&.dialog,
&.msg,
&.msg_text,
&.msg_text_primary,
&.msg_success,
&.msg_warn,
&.toast,
&.article,
&.form,
&.loadmore,
&.picker,
&.top-tips,
&.steps,
&.steps_vertical,
&.steps_horizonal,
&.progress {
background-color: var(--weui-BG-2);
}
}
/* lib */
.link {
color: var(--weui-LINK);
}
/* layout */
.container {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
color: var(--weui-FG-0);
}
.page {
outline: 0;
}
.page__hd {
padding: 40px;
}
.page__bd {}
.page__bd_spacing {
padding: 0 16px;
}
.page__ft {
padding-top: 40px;
padding-bottom: 32px;
padding-bottom: calc(32px ~"+ constant(safe-area-inset-bottom)");
padding-bottom: calc(32px ~"+ env(safe-area-inset-bottom)");
text-align: center;
img {
height: 19px;
.dark({
filter: invert(100) hue-rotate(180deg);
});
}
&.j_bottom {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.weui-footer{
display:none;
padding:16px 0 0;
}
.weui-footer__text{
margin-bottom:8px;
&:last-child{
margin-bottom:0;
}
}
.weui-footer__text__meta{
margin:0 6px;
}
a.weui-footer__text__meta{
color:rgba(0,0,0,.2);
.dark({
color:rgba(255,255,255,.2);
});
&:active{
opacity:.5;
}
}
.gongan_meta{
display:inline-flex;
vertical-align:bottom;
align-items:center;
img{
margin-right:2px;
width:18px;
height:18px;
}
}
}
.page__title {
text-align: left;
font-size: 20px;
font-weight: 400;
}
.page__desc {
margin-top: 4px;
color: var(--weui-FG-1);
text-align: left;
font-size: 14px;
}
.page {
&.footer,
&[class*="form_"],
&.gallery,
&[class*="msg_"],
&[class*="button_"],
&.navbar,
&.tabbar {
.page__ft {
display: none;
}
}
}
/* widget */
.weui-cell_example {
&:before {
left: 52px;
}
}
.page.home {
@pageHomePadding: 20px;
.page__intro-icon {
margin-top: -0.2em;
margin-left: 5px;
width: 16px;
height: 16px;
vertical-align: middle;
}
.page__title {
font-size: 0;
margin-bottom: 15px;
.dark({
filter: invert(100) hue-rotate(180deg);
});
}
.page__bd {
img {
width: 30px;
height: 30px;
.dark({
filter: invert(100) hue-rotate(180deg);
});
}
li {
margin: 8px 0;
background-color: var(--weui-BG-2);
overflow: hidden;
border-radius: 2px;
cursor: default;
&.js_show {
.weui-flex {
opacity: 0.5;
}
.page__category {
height: auto;
}
.page__category-content {
opacity: 1;
transform: translateY(0);
}
}
&:first-child {
margin-top: 0;
}
}
}
.page__category {
height: 0;
overflow: hidden;
}
.page__category-content {
opacity: 0;
transform: translateY(-50%);
transition: 0.3s;
}
.weui-flex {
padding: @pageHomePadding;
align-items: center;
transition: 0.3s;
//&:active{
// background-color: #ECECEC;
//}
}
.weui-cells {
margin-top: 0;
&:before,
&:after {
display: none;
}
}
.weui-cell {
padding-left: @pageHomePadding;
padding-right: @pageHomePadding;
&:before {
left: @pageHomePadding;
right: @pageHomePadding;
}
}
}
.page.steps_vertical ,
.page.steps_horizonal {
.weui-steps{
margin:40px auto 80px;
max-width:50%;
}
}
.page.badge {
.demo_badge_tips {
vertical-align: middle;
font-size: 17px;
& + .weui-badge {
margin-left: 5px;
margin-right: 5px;
}
}
.demo_badge_cells {
.weui-cell__hd {
position: relative;
margin-right: 10px;
img {
width: 50px;
display: block;
}
.weui-badge {
position: absolute;
top: -0.4em;
right: -0.4em;
}
}
.weui-cell__bd {
.demo_badge_title {
vertical-align: middle;
& + .weui-badge {
margin-left: 5px;
}
}
.demo_badge_desc {
display: block;
font-size: 13px;
color: #888;
}
}
}
}
.page.form {
.page__bd {
padding-bottom: 30px;
}
.weui-label {
width: 3.14em;
}
}
.page.form_page {
.weui-label { width: 4.2em; }
}
.page.form_primary,
.page.form_select,
.page.form_select_primary {
.weui-cell_select-before .weui-select,
.weui-label { width: 3.14em; }
}
[class^="form_"],
[class*=" form_"] {
&.page {
padding: 0;
}
}
.page.form_vcode,
.page.form_input_status{
.weui-label { width: 3.14em; }
}
.page.button,
.page.button_default {
background-color: var(--weui-BG-0);
.weui-btn_mini {
vertical-align: middle;
margin: 0 12px;
}
.page__bd {
padding: 0;
}
.button-sp-area {
margin: 15px auto;
padding: 15px;
text-align: center;
&.cell {
padding: 15px 0;
display:none;
}
&.overlay {
padding: 15px 0;
background:var(--weui-BRAND);
.weui-btn_mini{
margin-top:16px;
}
}
}
}
.page.button_bottom_fixed {
background-color: var(--weui-BG-2);
.weui-bottom-fixed-opr-demo {
padding: 32px 32px 0;
}
}
.page.cell {
.page__bd {
padding-bottom: 30px;
}
}
.page.dialog {
.page__bd {
padding: 0 15px;
}
}
.page.panel {
.page__bd {
padding-bottom: 20px;
}
.weui-cell_example {
.weui-cell__hd {
img {
width: 20px;
height: 20px;
display: block;
margin-right: 16px;
}
}
}
}
.page.icons-svg,
.page.icons {
text-align: center;
.page__bd {
padding: 0 40px;
text-align: left;
}
.icon-box {
margin-bottom: 25px;
display: flex;
align-items: center;
i {
margin-right: 18px;
}
}
.icon-box__ctn {
flex-shrink: 100;
}
.icon-box__title {
font-weight: normal;
}
.icon-box__desc {
margin-top: 6px;
font-size: 12px;
color: #888;
}
.icon_sp_area {
margin-top: 10px;
text-align: left;
i:before {
margin-bottom: 5px;
}
}
}
.page.flex {
.placeholder {
margin: 5px;
padding: 0 10px;
background-color: var(--weui-BG-1);
height: 2.3em;
line-height: 2.3;
text-align: center;
color: var(--weui-FG-1);
}
}
.page.layers {
@layerBaseTransform: translateX(15px) rotateX(45deg) rotateZ(10deg) skew(-15deg);
@layerStartPos: 120px;
@layerSpacing: 80px;
@layerSmallStartPos: 140px;
@layerSmallSpacing: 60px;
overflow-x: hidden;
perspective: 1000px;
.page__hd {
@media only screen and (max-width: 320px) {
padding-left: 20px;
padding-right: 20px;
}
}
.page__bd {
position: relative;
}
.page__desc {
min-height: 1.6 * 3em;
}
.layers__layer {
position: absolute;
left: 50%;
width: 150px;
height: 266px;
margin-left: -75px;
box-sizing: border-box;
transition: 0.5s;
background: url(images/layers/transparent.gif) no-repeat center center;
background-size: contain;
font-size: 14px;
color: var(--weui-WHITE);
span {
position: absolute;
bottom: 5px;
left: 0;
right: 0;
text-align: center;
transition: 0.5s;
}
&:last-child {
span {
color: #aaa;
}
}
&.j_hide {
opacity: 0;
}
&.j_pic {
span {
color: transparent;
}
}
@media only screen and (min-width: 375px) and (min-height: 603px) {
width: 180px;
height: 320px;
margin-left: -90px;
}
@media only screen and (min-width: 414px) and (min-height: 640px) {
width: 200px;
height: 355px;
margin-left: -100px;
}
}
.layers__layer_popout {
border: 1px solid rgba(203, 203, 203, 0.5);
z-index: 4;
&.j_transform {
transform: @layerBaseTransform translateZ(@layerStartPos);
@media only screen and (max-width: 320px) {
transform: @layerBaseTransform translateZ(@layerSmallStartPos);
}
}
&.j_pic {
border-color: transparent;
background-image: url(images/layers/popout.png);
}
}
.layers__layer_mask {
background-color: rgba(0, 0, 0, 0.5);
z-index: 3;
&.j_transform {
transform: @layerBaseTransform translateZ(@layerStartPos - @layerSpacing);
@media only screen and (max-width: 320px) {
transform: @layerBaseTransform translateZ(@layerSmallStartPos - @layerSmallSpacing);
}
}
}
.layers__layer_navigation {
background-color: rgba(40, 187, 102, 0.5);
z-index: 2;
&.j_transform {
transform: @layerBaseTransform translateZ(@layerStartPos - 2 * @layerSpacing);
@media only screen and (max-width: 320px) {
transform: @layerBaseTransform translateZ(@layerSmallStartPos - 2 * @layerSmallSpacing);
}
}
&.j_pic {
background-color: transparent;
background-image: url(images/layers/navigation.png);
}
}
.layers__layer_content {
background-color: var(--weui-BG-2);
z-index: 1;
&.j_transform {
transform: @layerBaseTransform translateZ(@layerStartPos - 3 * @layerSpacing);
@media only screen and (max-width: 320px) {
transform: @layerBaseTransform translateZ(@layerSmallStartPos - 3 * @layerSmallSpacing);
}
}
&.j_pic {
background-image: url(images/layers/content.png);
}
}
}
.page.searchbar_homepage,
.page.searchbar_filled {
background:var(--weui-BG-3);
.searchbar-result {
display: none;
margin-top: 0;
font-size: 14px;
.weui-cell__bd {
padding: 2px 0 2px 20px;
color: var(--weui-FG-1);
}
}
}
.page.information-bar {
.weui-information-bar{
position:static;
margin-bottom:20px;
}
}
.page.gallery {
overflow: hidden;
}
.page.tabbar,
.page.navbar {
.weui-tab__panel {
padding: 32px;
}
}
.weui-half-screen-dialog {
transition: transform 0.3s;
transform: translateY(100%);
}
.weui-half-screen-dialog_show {
transform: translateY(0);
}
.loading_demo {
display: flex;
align-items: center;
justify-content: center;
margin:10px 40px;
.weui-loading,
.weui-mask-loading,
.weui-primary-loading {
margin: 0 5px;
}
}
/* animation */
@keyframes slideIn {
from {
transform: translate3d(100%, 0, 0);
opacity: 0;
}
to {
transform: translate3d(0, 0, 0);
opacity: 1;
}
}
@keyframes slideOut {
from {
transform: translate3d(0, 0, 0);
opacity: 1;
}
to {
transform: translate3d(100%, 0, 0);
opacity: 0;
}
}
.page.slideIn {
animation: slideIn 0.2s forwards;
}
.page.slideOut {
animation: slideOut 0.2s forwards;
}
.page_logo_wrp{
display:flex;
justify-content:center;
&>a{
display:inline-flex;
vertical-align:bottom;
}
}
// iphone x
@supports (top: constant(safe-area-inset-top)) {
.page {
padding: constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);
&.tabbar,
&.navbar {
padding-left: 0;
padding-right: 0;
}
}
.weui-tab__panel {
padding-left: constant(safe-area-inset-left);
padding-right: constant(safe-area-inset-right);
}
}
@supports (top: env(safe-area-inset-top)) {
.page {
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
&.tabbar,
&.navbar,
&.msg_success,
&.msg_warn,
&.msg_text,
&.msg_text_primary,
&.article {
padding: 0;
}
}
}
@media (min-device-width: 768px) {
.page__ft{
padding-bottom:48px;
.weui-footer{
display:block;
}
}
}