vue项目rem适配

src-assets-css-base.css

@charset "utf-8";
* {
    
    
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "SF Pro SC", "SF Pro Display", "SF Pro Icons", "PingFang SC", sans-serif,
  "Helvetica Neue", "Helvetica", "Arial", "PingFangSC-Regula", sans-serif;
}
body {
    
    
  background: #fff;
  color: #3e3a39;
}
@media screen and (max-width: 750px) {
    
    
  html {
    
    
    font-size: calc(100vw / 7.5);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }
}
@media screen and (min-width: 751px) {
    
    
  html {
    
    
    font-size: 300%;
    max-width: 750px;
    margin: 0 auto;
  }
}
@media screen and (min-width: 980px) {
    
    
  html {
    
    
    /* font-size: 100%; */
    max-width: 100vw;
    margin: 0;
  }
}
li,
ol {
    
    
  list-style: none;
}
a {
    
    
  text-decoration: none;
}
em {
    
    
  font-style: normal;
}
img {
    
    
  display: block;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    
    
  font-weight: normal;
}
input,
textarea,
select,
button {
    
    
  outline: none;
}
input {
    
    
  -webkit-appearance: none;
  appearance: none;
}
button,
input {
    
    
  border: none;
  outline: none;
}
input::-webkit-datetime-edit-fields-wrapper {
    
    
  /* visibility: hidden; */
}
input[type="date"]::-webkit-inner-spin-button {
    
    
  visibility: hidden;
}
textarea,
input[type="password"],
input[type="text"] {
    
    
  resize: none;
  outline: 0;
  -webkit-appearance: none;
}
/*清除浮动代码*/
.clearfloat:after {
    
    
  display: block;
  clear: both;
  content: "";
  visibility: hidden;
  height: 0;
}
.clearfloat {
    
    
  zoom: 1;
}
input::-webkit-input-placeholder {
    
    
  font-size: 0.3rem;
  color: #d5d1d1 !important;
}
textarea::-webkit-input-placeholder {
    
    
  color: #d5d1d1 !important;
  font-size: 0.3rem;
}
textarea::placeholder {
    
    
  color: #d5d1d1 !important;
  font-size: 0.3rem;
}
/* 1px线 */
.border-bottom {
    
    
  position: relative;
}
.border-bottom:before {
    
    
  content: "";
  position: absolute;
  width: 200%;
  height: 1px;
  bottom: 0;
  left: 0;
  border-bottom: 1px solid #e8e8e8;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scale(0.5, 0.5);
  transform: scale(0.5, 0.5);
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

main.js

import './assets/css/base.css'

猜你喜欢

转载自blog.csdn.net/weixin_46370288/article/details/139409655