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

less로 calc를 컴파일하니 의도와 달라지네요 #464

Open
jhson0531 opened this issue Aug 14, 2018 · 1 comment
Open

less로 calc를 컴파일하니 의도와 달라지네요 #464

jhson0531 opened this issue Aug 14, 2018 · 1 comment
Labels

Comments

@jhson0531
Copy link

jhson0531 commented Aug 14, 2018

해결하고자 하는 문제

원래 하고싶었던 것은 css에서
width: calc(100% - 250px); 을 하려고 했습니다 (반응형웹이고, float를 사용해서 너비가 250px인 div가 같은 행에 있음)

근데 최근에 egoing님께서 less를 쓰면 변수도 사용할수있다고 하여 less를 쓰려고 했는데
less에서는
width: calc(-150%) 라고 나타내더라고요...

width: calc(100% - 25px)로 바꾸니 width: calc(75%)가 되는 것으로 보아 100과 250을 연산시켜버린 것 같은데 어떻게 해결해야하나요 이 문제를 ㅠㅠ

환경

winless 사용했고, 컴파일 후 link로 php에 연결했습니다

@jhson0531 jhson0531 changed the title less로 calc를 컴파일하니 의도와 달라지네요... less로 calc를 컴파일하니 의도와 달라지네요 Aug 14, 2018
@yoobato
Copy link
Collaborator

yoobato commented Aug 14, 2018

Less에서는, calc()를 사용할 때, width: ~"calc(100% -250px)";와 같이 사용하셔야 합니다.

아래 링크 참고해보세요!
https://coderwall.com/p/yyou-q/css3-calc-in-less-css
less/less.js#974

@yoobato yoobato added the css label Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants