uni.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /**
  2. * 这里是app内置的常用样式变量
  3. *
  4. * app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
  5. * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
  6. *
  7. */
  8. /**
  9. * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
  10. *
  11. * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
  12. */
  13. /* 颜色变量 */
  14. @import '@/uni_modules/uni-scss/variables.scss';
  15. /* 行为相关颜色 */
  16. $color-primary: #317afd;
  17. $color-success: #4cd964;
  18. $color-warning: #f0ad4e;
  19. $color-error: #e93f27;
  20. /* 文字基本颜色 */
  21. $text-color:#333;//基本色
  22. $text-color-info:#666;
  23. $text-color-inverse:#fff;//反色
  24. $text-color-grey:#999;//辅助灰色,如加载更多的提示信息
  25. $text-color-placeholder: #808080;
  26. $text-color-disable:#cccccc;
  27. /* 背景颜色 */
  28. $bg-color:#ffffff;
  29. $bg-color-grey:#f3f5f9;
  30. $bg-color-hover:#f1f1f1;//点击状态颜色
  31. $bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
  32. /* 边框颜色 */
  33. $border-color:#c8c7cc;
  34. /* 尺寸变量 */
  35. /* 文字尺寸 */
  36. $font-size-sm:12px;
  37. $font-size-base:14px;
  38. $font-size-lg:16;
  39. /* 图片尺寸 */
  40. $img-size-sm:20px;
  41. $img-size-base:26px;
  42. $img-size-lg:40px;
  43. /* Border Radius */
  44. $border-radius-sm: 2px;
  45. $border-radius-base: 3px;
  46. $border-radius-lg: 6px;
  47. $border-radius-circle: 50%;
  48. /* 水平间距 */
  49. $spacing-row-sm: 5px;
  50. $spacing-row-base: 10px;
  51. $spacing-row-lg: 15px;
  52. /* 垂直间距 */
  53. $spacing-col-sm: 4px;
  54. $spacing-col-base: 8px;
  55. $spacing-col-lg: 12px;
  56. /* 透明度 */
  57. $opacity-disabled: 0.3; // 组件禁用态的透明度
  58. /* 文章场景相关 */
  59. $color-title: #333; // 文章标题颜色
  60. $font-size-title:32rpx;
  61. $line-height-title:44rpx;
  62. $color-subtitle: #666; // 二级标题颜色
  63. $font-size-subtitle:28rpx;
  64. $line-height-subtitle:40rpx;
  65. $color-paragraph: #999; // 文章段落颜色
  66. $font-size-paragraph:28rpx;
  67. $line-height-paragraph:40rpx;
  68. @mixin setIconBg ($width,$height,$url){
  69. content: ' ';
  70. position: absolute;
  71. left: 0rpx;
  72. top: 0;
  73. bottom: 0;
  74. margin: auto;
  75. background-image: url('@/static/'+$url);
  76. background-size: #{$width}rpx #{$height}rpx;
  77. background-position: center;
  78. width: #{$width}rpx;
  79. height: #{$height}rpx;
  80. }
  81. @mixin setIcon ($width, $height, $url) {
  82. content: ' ';
  83. width: #{$width}rpx;
  84. height: #{$height}rpx;
  85. background: url('@/static/'+$url) center no-repeat;
  86. background-size: #{$width}rpx #{$height}rpx;
  87. }