GithubHelp home page GithubHelp logo

Comments (10)

wswmsword avatar wswmsword commented on May 26, 2024

不好意思,没理解您的意思

from postcss-mobile-forever.

1390006090 avatar 1390006090 commented on May 26, 2024
  postcsspxtoviewport8plugin({
      unitToConvert: 'px', // 需要转换的单位,默认为"px"
      viewportWidth: 1080, // 设计稿的视口宽度
      mediaQuery: true, // 媒体查询里的单位是否需要转换单位
      unitPrecision: 6, // 单位转换后保留的精度
      landscape: true, // 是否添加根据 landscapeWidth 生成的媒体查询条件 @media (orientation: landscape)
      landscapeUnit: 'vw',// 横屏时使用的单位
      landscapeWidth: 1920,// 横屏时使用的视口宽度

from postcss-mobile-forever.

1390006090 avatar 1390006090 commented on May 26, 2024

landscape: true, // 是否添加根据 landscapeWidth 生成的媒体查询条件 @media (orientation: landscape)
就是这个功能

from postcss-mobile-forever.

wswmsword avatar wswmsword commented on May 26, 2024
{
  "viewportWidth": 1080,
  "appSelector": "#app",
  "enableMediaQuery": true,
  "landscapeWidth": 1920,
}

插件可以设置媒体查询横屏下的视口宽度,您看下这个符合你的需求吗?上面的 "landscapeWidth": 1920 设置了横屏时的视口宽度 1920 像素,如果再设置 "desktop: xxx",就是设置桌面端的视口宽度为 xxx。

from postcss-mobile-forever.

1390006090 avatar 1390006090 commented on May 26, 2024
  "mobileUnit":"vw",
      "viewportWidth": 1080,
      "appSelector": "#app",
      "enableMediaQuery": true,
      "landscapeWidth": 1920,
      "desktopWidth":1920

Uploading 1711616172196.jpg…

from postcss-mobile-forever.

1390006090 avatar 1390006090 commented on May 26, 2024

@media (min-width: 1920px) and (max-height: 640px), (max-width: 1920px) and (min-width: 1920px) and (orientation: landscape)

<style> .index-container .index-introduce[data-v-93195b7f], .index-container .index-menu[data-v-93195b7f] { height: 1848.889px;

from postcss-mobile-forever.

1390006090 avatar 1390006090 commented on May 26, 2024

转换出来成这样了

from postcss-mobile-forever.

1390006090 avatar 1390006090 commented on May 26, 2024

没转成vw还是px

from postcss-mobile-forever.

wswmsword avatar wswmsword commented on May 26, 2024

转换的媒体查询代码,里面的单位是 px,这是因为匹配到媒体查询后,视图应该是保持不变的,也就是固定尺寸的。如果你看非媒体查询的代码,都已经转换为 vw 了。

from postcss-mobile-forever.

1390006090 avatar 1390006090 commented on May 26, 2024

我以为都会转换....

from postcss-mobile-forever.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.