I
I
Ivan2017-02-28 15:54:28
css
Ivan, 2017-02-28 15:54:28

Why is my less not working?

What am I doing wrong? Where is the mistake?

.case-parameters(@cn) {
.block-case li:before:nth-of-type((cn)) {
  font-weight: bold;
  z-index: 1;
  position: absolute;
  margin-top: 35px;
  background: #fff;
  color: #FC0D55;
  font-size: 20px;
    content: "текст";
  width: 80px;
    height: 27px;
  display: block;
  line-height: 25px;
  text-indent: 10px;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2017-02-28
@Captain96

I suspect that it's not less that doesn't work, but css.
First nth-child, and then before. Because before has no children at all.
Well, in less itself:

.case-parameters(@cn) {
  .block-case li:nth-of-type(@{cn}):before {
  font-weight: bold;
  z-index: 1;
  position: absolute;
  margin-top: 35px;
  background: #fff;
  color: #FC0D55;
  font-size: 20px;
    content: "текст";
  width: 80px;
  height: 27px;
  display: block;
  line-height: 25px;
  text-indent: 10px;
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question