Skip to content

Commit

Permalink
feat(cli/site): 修改手机样式 自适应高度
Browse files Browse the repository at this point in the history
affects: @varlet/cli, @varlet/ui
  • Loading branch information
haoziqaq committed Apr 17, 2021
1 parent 6d711c7 commit 37029e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 29 deletions.
34 changes: 9 additions & 25 deletions packages/varlet-cli/site/pc/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,11 @@
<div class="varlet-site-code" :ref="code">
<router-view />
</div>
<div class="varlet-site-mobile">
<div class="varlet-site-mobile var-elevation--3">
<div class="varlet-site-empty"></div>
<div class="varlet-site-mobile-content">
<iframe :src="`./mobile.html#/${componentName}?language=${language}&platform=pc&path=${path}`"></iframe>
</div>
<div class="varlet-site-mobile-image">
<img src="./assets/images/mobile.png" />
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -314,19 +311,18 @@ iframe {
&-site {
&-mobile {
flex: 0 0 432px;
transform: scale(0.88) translateZ(0);
flex: 0 0 325px;
position: relative;
height: 863px;
height: calc(100vh - 100px);
align-self: center;
margin-left: 30px;
margin-right: 38px;
overflow: hidden;
border-radius: 8px;
&-content {
height: 780px;
position: absolute;
z-index: -2;
top: 57px;
width: calc(100% - 57px);
margin-left: 28px;
width: 100%;
height: 100%;
}
&-image {
Expand All @@ -342,18 +338,6 @@ iframe {
}
}
@media screen and (max-width: 1280px) {
&-mobile {
transform: scale(0.66) translateZ(0);
}
}
@media screen and (min-width: 1281px) and (max-width: 1600px) {
&-mobile {
transform: scale(0.7) translateZ(0);
}
}
&-empty {
height: 34px;
width: calc(100% - 40px);
Expand Down
8 changes: 4 additions & 4 deletions packages/varlet-ui/src/styles/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ export default {
.list {
display: flex;
flex-wrap: wrap;
padding: 6px;
padding: 2vw;
&__item {
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 100px;
width: 25vw;
height: 25vw;
color: #888;
margin: 6px;
margin: 2vw;
}
}
</style>

0 comments on commit 37029e2

Please sign in to comment.