SASS 변수를 CSS`Content` 속성의 값으로 사용
-
11-12-2019 - |
문제
안녕하세요!
이것은 Sass / Compass의 이해가 부족하여 발생할 수 있습니다.
다음 SASS 코드로 그리드 너비를 출력하려고합니다.
$total-columns : 4
$column-width : 4em // each column is 4em wide
$gutter-width : $column-width / 2 // 1em gutters between columns
$grid-padding : $gutter-width / 2 // grid-padding equal to gutters
#page
+container
+susy-grid-background
#block-block-3
div.content
p:first-of-type:after
content: columns-width()
.
블록 3에 인쇄되지 않습니다. (
나는 또한 content: columns-width($total-columns)
를 시도했는데, 아직 아무 것도하지 않습니다.content: "foo"
를 수행하면 "foo"가 인쇄됩니다.
나는 무엇을 잘못하고 있습니까?Susy 계산 된 격자 너비는 어떻게 보입니까?또한 compass watch
출력으로 인쇄 할 수 있습니까?
해결책
솔루션은 보간 : 을 사용하고 있습니다.
content: "#{columns-width($total-columns)}"
. 제휴하지 않습니다 StackOverflow