Style of the component
If you use Ray to build a miniapp or a WeChat miniApp, responsive pixel (rpx) is recommended.
rpx can be used to adapt to screen width. The specified screen width is 750rpx. Take iPhone 6 as an example. The screen width is 375px and has total 750 physical pixels.
750rpx = 375px = 750 physical pixels, 1rpx = 0.5px = 1 physical pixel.
Preprocessor
Ray supports less by default. In the future, more preprocessor settings will be available in the form of plugins.
px conversion
Ray uses the px unit. This unit remains unchanged when you build a miniapp. If you build a web app, px is converted to rem, with a ratio of 100:1.
Example:
Build a miniapp
Build a web app
CSS Modules
Ray automatically recognizes CSS Modules. Files with .module.css or .module.less suffixes are recognized as CSS Modules files.
Example: