提交 b78dde42 编写于 作者: fxy060608's avatar fxy060608

wip(uvue): 拆分 slider.css,不使用条件编译

上级 85ac9b04
......@@ -50,6 +50,7 @@ export const H5_API_STYLE_PATH = '@dcloudio/uni-h5/style/api/'
export const H5_FRAMEWORK_STYLE_PATH = '@dcloudio/uni-h5/style/framework/'
export const H5_COMPONENTS_STYLE_PATH = '@dcloudio/uni-h5/style/'
export const BASE_COMPONENTS_STYLE_PATH = '@dcloudio/uni-components/style/'
export const X_BASE_COMPONENTS_STYLE_PATH = '@dcloudio/uni-components/style-x/'
export const COMMON_EXCLUDE = [
/\/pages\.json\.js$/,
......
......@@ -5,6 +5,7 @@
"main": "index.js",
"files": [
"style",
"style-x",
"lib",
"lib-x"
],
......
uni-slider {
display: block;
margin-top: 1px;
margin-bottom: 1px;
}
uni-slider[hidden] {
display: none;
}
uni-slider .uni-slider-brower-input-range {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
}
uni-slider .uni-slider-wrapper {
position: relative;
display: flex;
align-items: center;
min-height: 8px;
margin-top: 4px;
margin-bottom: 4px;
}
uni-slider .uni-slider-input {
position: relative;
flex: 1;
}
uni-slider .uni-slider-track {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin-top: auto;
margin-bottom: auto;
height: 2px;
border-radius: 5px;
background-color: #e9e9e9;
cursor: pointer;
transition: background-color 0.3s ease;
-webkit-tap-highlight-color: transparent;
}
uni-slider .uni-slider-track-value {
height: 100%;
border-radius: 6px;
background-color: #007aff;
transition: background-color 0.3s ease;
}
uni-slider .uni-slider-thumb-value {
position: relative;
cursor: pointer;
border-radius: 50%;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
transition: border-color 0.3s ease;
}
uni-slider .uni-slider-value {
width: 4ch;
color: #888;
font-size: 14px;
margin-left: 3px;
}
uni-slider .uni-slider-disabled .uni-slider-track {
background-color: #ccc;
}
uni-slider .uni-slider-disabled .uni-slider-thumb-value {
background-color: #fff;
border-color: #ccc;
}
/* #ifndef UNI-APP-X */
uni-slider {
margin: 10px 18px;
padding: 0;
......@@ -88,87 +87,3 @@ uni-slider .uni-slider-disabled .uni-slider-thumb {
background-color: #fff;
border-color: #ccc;
}
/* #endif */
/* #ifdef UNI-APP-X */
uni-slider {
display: block;
margin-top: 1px;
margin-bottom: 1px;
}
uni-slider[hidden] {
display: none;
}
uni-slider .uni-slider-brower-input-range {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
}
uni-slider .uni-slider-wrapper {
position: relative;
display: flex;
align-items: center;
min-height: 8px;
margin-top: 4px;
margin-bottom: 4px;
}
uni-slider .uni-slider-input {
position: relative;
flex: 1;
}
uni-slider .uni-slider-track {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin-top: auto;
margin-bottom: auto;
height: 2px;
border-radius: 5px;
background-color: #e9e9e9;
cursor: pointer;
transition: background-color 0.3s ease;
-webkit-tap-highlight-color: transparent;
}
uni-slider .uni-slider-track-value {
height: 100%;
border-radius: 6px;
background-color: #007aff;
transition: background-color 0.3s ease;
}
uni-slider .uni-slider-thumb-value {
position: relative;
cursor: pointer;
border-radius: 50%;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
transition: border-color 0.3s ease;
}
uni-slider .uni-slider-value {
width: 4ch;
color: #888;
font-size: 14px;
margin-left: 3px;
}
uni-slider .uni-slider-disabled .uni-slider-track {
background-color: #ccc;
}
uni-slider .uni-slider-disabled .uni-slider-thumb-value {
background-color: #fff;
border-color: #ccc;
}
/* #endif */
\ No newline at end of file
......@@ -7,6 +7,7 @@ import { COMPONENT_PREFIX, isBuiltInComponent } from '@dcloudio/uni-shared'
import {
H5_COMPONENTS_STYLE_PATH,
BASE_COMPONENTS_STYLE_PATH,
X_BASE_COMPONENTS_STYLE_PATH,
COMPONENT_DEPS_CSS,
parseVueRequest,
buildInCssSet,
......@@ -19,6 +20,7 @@ import {
const H5_COMPONENTS_PATH = '@dcloudio/uni-h5'
const xBaseComponents = ['slider']
const baseComponents = [
'audio',
'button',
......@@ -133,7 +135,12 @@ export function uniEasycomPlugin(options: UniEasycomPluginOptions): Plugin {
function resolveBuiltInCssImport(name: string) {
const cssImports: string[] = []
if (baseComponents.includes(name)) {
cssImports.push(BASE_COMPONENTS_STYLE_PATH + name + '.css')
const isX = process.env.UNI_APP_X === 'true'
if (isX && xBaseComponents.includes(name)) {
cssImports.push(X_BASE_COMPONENTS_STYLE_PATH + name + '.css')
} else {
cssImports.push(BASE_COMPONENTS_STYLE_PATH + name + '.css')
}
} else {
cssImports.push(H5_COMPONENTS_STYLE_PATH + name + '.css')
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册