uni.scss 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /**
  2. * uni-app内置的常用样式变量
  3. */
  4. /* 行为相关颜色 */
  5. $uni-color-primary: #007aff;
  6. $uni-color-success: #4cd964;
  7. $uni-color-warning: #f0ad4e;
  8. $uni-color-error: #dd524d;
  9. /* 文字基本颜色 */
  10. $uni-text-color:#333;//基本色
  11. $uni-text-color-inverse:#fff;//反色
  12. $uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
  13. $uni-text-color-placeholder: #808080;
  14. $uni-text-color-disable:#c0c0c0;
  15. /* 背景颜色 */
  16. $uni-bg-color:#ffffff;
  17. $uni-bg-color-grey:#f8f8f8;
  18. $uni-bg-color-hover:#f1f1f1;//点击状态颜色
  19. $uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
  20. /* 边框颜色 */
  21. $uni-border-color:#e5e5e5;
  22. /* 尺寸变量 */
  23. /* 文字尺寸 */
  24. $uni-font-size-sm:12px;
  25. $uni-font-size-base:14px;
  26. $uni-font-size-lg:16px;
  27. /* 图片尺寸 */
  28. $uni-img-size-sm:20px;
  29. $uni-img-size-base:26px;
  30. $uni-img-size-lg:40px;
  31. /* Border Radius */
  32. $uni-border-radius-sm: 2px;
  33. $uni-border-radius-base: 3px;
  34. $uni-border-radius-lg: 6px;
  35. $uni-border-radius-circle: 50%;
  36. /* 水平间距 */
  37. $uni-spacing-row-sm: 5px;
  38. $uni-spacing-row-base: 10px;
  39. $uni-spacing-row-lg: 15px;
  40. /* 垂直间距 */
  41. $uni-spacing-col-sm: 4px;
  42. $uni-spacing-col-base: 8px;
  43. $uni-spacing-col-lg: 12px;
  44. /* 透明度 */
  45. $uni-opacity-disabled: 0.3; // 组件禁用态的透明度
  46. /* 文章场景相关 */
  47. $uni-color-title: #2C405A; // 文章标题颜色
  48. $uni-font-size-title:20px;
  49. $uni-color-subtitle: #555555; // 二级标题颜色
  50. $uni-font-size-subtitle:26px;
  51. $uni-color-paragraph: #3F536E; // 文章段落颜色
  52. $uni-font-size-paragraph:15px;
  53. /* 颜色变量 */
  54. // @import '@/uni_modules/uview-ui/theme.scss';
  55. /**
  56. * 自定义颜色
  57. */
  58. $brand-theme-color:#EC544F; //品牌主体红色
  59. $brand-theme-color-aux:#576b95; //品牌辅助色
  60. $page-bg-color:#F7F7F7; //页面背景色
  61. $border-color:#e0e0e0; //边框颜色
  62. $border-color-light:#efefef; //边框亮色
  63. $text-font-color-1:#000; //文字主色
  64. $text-font-color-2:#676767; //副标题颜色
  65. $text-font-color-3:#a7a7a7; //浅色
  66. @mixin flex-box {
  67. display: flex;
  68. justify-content: space-between;
  69. align-items: center;
  70. }
  71. @mixin flex-box-set($jc:center,$ai:center) {
  72. @include flex-box();
  73. @if($jc == center){
  74. justify-content: center;
  75. }
  76. @if($jc == start){
  77. justify-content: flex-start;
  78. }
  79. @if($jc == end){
  80. justify-content: flex-end;
  81. }
  82. @if($jc == between){
  83. justify-content: space-between;
  84. }
  85. @if($ai == center){
  86. align-items: center;
  87. }
  88. @if($ai == start){
  89. align-items: flex-start;
  90. }
  91. @if($ai == end){
  92. align-items: flex-end;
  93. }
  94. }
  95. @mixin ellipsis($row:1){
  96. text-overflow: -o-ellipsis-lastline;
  97. overflow: hidden; //溢出内容隐藏
  98. text-overflow: ellipsis; //文本溢出部分用省略号表示
  99. display: -webkit-box; //特别显示模式
  100. -webkit-line-clamp: $row; //行数
  101. line-clamp: $row;
  102. -webkit-box-orient: vertical; //盒子中内容竖直排列
  103. }