Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Syntax Error: line-height: #{math.div($--input-height - 2, 2)}; ^ Invalid CSS after "...-height: #{math": expected expression (e.g. 1px, bold), was ".div($--input-heigh" in C:\Users\Administrator\WebstormProjects\winn-front\node_ modules\element-plus\packages\theme-chalk\src\input-number.scss (line 142, column 26) #2128

Closed
Wxdddd opened this issue Jun 2, 2021 · 3 comments

Comments

@Wxdddd
Copy link

Wxdddd commented Jun 2, 2021

Existing Component

Component Name

Element Plus

Description

element-variable.scss file

/* 改变 icon 字体路径变量,必需 */
$--color-primary: #3963bc;
$--font-path: '~element-plus/lib/theme-chalk/fonts';
@import "~element-plus/packages/theme-chalk/src/index";

main.js file
import { createApp } from 'vue'
import app from './app.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'

import '@/assets/style/realize/element-variable.scss'

const App = createApp(app)
// App.config.globalProperties.$ELEMENT = { size: 'small', zIndex: 3000 }
App.use(store)
.use(router)
.use(ElementPlus)
.mount('#app')

Syntax Error:
line-height: #{math.div($--input-height - 2, 2)};
^
Invalid CSS after "...-height: #{math": expected expression (e.g. 1px, bold), was ".div($--input-heigh"
in C:\Users\Administrator\WebstormProjects\winn-front\node_modules\element-plus\packages\theme-chalk\src\input-number.scss (line 142, column 26)

@element-bot element-bot changed the title [Feature Request] Syntax Error: line-height: #{math.div($--input-height - 2, 2)}; ^ Invalid CSS after "...-height: #{math": expected expression (e.g. 1px, bold), was ".div($--input-heigh" in C:\Users\Administrator\WebstormProjects\winn-front\node_modules\element-plus\packages\theme-chalk\src\input-number.scss (line 142, column 26) [Feature Request] Syntax Error: line-height: #{math.div($--input-height - 2, 2)}; ^ Invalid CSS after "...-height: #{math": expected expression (e.g. 1px, bold), was ".div($--input-heigh" in C:\Users\Administrator\WebstormProjects\winn-front\node_ modules\element-plus\packages\theme-chalk\src\input-number.scss (line 142, column 26) Jun 2, 2021
@element-bot
Copy link
Member

Translation of this issue:

Existing Component

yes

Component Name

Element Plus

Description

element-variable.scss file

/To change the icon font path variable, you must/
$--color-primary: #3963bc;

$--font-path: '~element-plus/lib/theme-chalk/fonts';
@import "~element-plus/packages/theme-chalk/src/index";

main.js file
import { createApp } from 'vue'

import app from './app.vue'
import router from './router'

import store from './store'
import ElementPlus from 'element-plus'

import '@/assets/style/realize/element-variable.scss'
const App = createApp(app)

// App.config.globalProperties.$ELEMENT = { size: 'small', zIndex: 3000 }
App.use(store)

.use(router)
.use(ElementPlus)

.mount('#app')
Syntax Error:

line-height: #{math.div($--input-height - 2, 2)};
^

Invalid CSS after "...-height: #{math": expected expression (e.g. 1px, bold), was ".div($--input-heigh"
in C:\Users\Administrator\WebstormProjects\winn-front\node_ modules\element-plus\packages\theme-chalk\src\input-number.scss (line 142, column 26)

@y3lousso
Copy link

y3lousso commented Jun 3, 2021

Why was it closed, I encountered the same issue :/

Edit : I found why ^^'
Just replace node-sass by sass (dart-sass)
https://sass-lang.com/documentation/modules/math

@kelvshi
Copy link

kelvshi commented Jun 12, 2021

Because of use dart-sass@v1.33.0; but if you update the dart-sass, you will recive the warnnings "Using / for division is deprecated and will be removed in Dart Sass 2.0.0",
sass/dart-sass#672

@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants