ColorUI-高颜值组件库

ColorUI是一个css库。(开发者才18岁,大牛~)如果使用原生小程序开发,从https://github.com/weilanwl/ColorUI/下载源码解压获得/demo,复制目录下的 /colorui 文件夹到你的项目根目录(与pages目录同级)。

目录结构如下:

 在app.wxss 引入关键Css :main.wxss ,icon.wxss


   
   
   
   
  1. /**app.wxss**/
  2. @ import "colorui/main.wxss";
  3. @ import "colorui/icon.wxss";

同时在微信开发者工具中,打开ColorUI2.0-demo,效果如下所示:

二、常见场景使用

选择你需要的样式,找到对应的.WXML,复制需要样式的代码到你需要的页面即可。

  • 比如常见的搜索框:

     


   
   
   
   
  1. class= "cu-bar bg-white search fixed" style= "top:{{CustomBar}}px">
  2. <view class="search-form round">
  3. <text class="icon-search"> text>
  4. <input type="text" placeholder="搜索" confirm-type="search" bindinput="searchIcon"> input>
  5. view>
  6. < /view>
  • 比如消息或者富矿状态下的数字标签类别:

       


   
   
   
   
  1. class= "padding flex justify-between align-center">
  2. class= "cu-avatar xl radius">
  3. class= "cu-tag badge"> 99+
  4. class= "cu-avatar xl radius" style= "background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg);">
  5. class= "cu-tag badge"> 9
  6. class= "cu-avatar xl radius">
  7. class= "cu-tag badge">
  8. class= "icon-people">
  9. class= "cu-avatar xl radius">
  10. class= "cu-tag badge"> 99+
  • 比如特殊样式的底部导航栏:

        


   
   
   
   
  1. class= "cu-bar tabbar margin-bottom-xl bg-white">
  2. class= "action text-green">
  3. class= "icon-homefill"> 首页
  4. class= "action text-gray">
  5. class= "icon-similar"> 分类
  6. class= "action text-gray add-action">
  7. 发布
  8. class= "action text-gray">
  9. class= "icon-cart">
  10. class= "cu-tag badge"> 99
  11. 购物车
  12. class= "action text-gray">
  13. class= "icon-my">
  14. class= "cu-tag badge">
  15. 我的

  更多操作,请参考ColorUI2.0-demo。

你可能感兴趣的:(微信小程序)