0

I'm using the Stylus extension in Chrome, trying to set multiple sites' main content to a certain char-per-line, what I'm trying firstly:

@-moz-document url-prefix("https://www.google.com/search?q=") {
.g {
    container-type: inline-size;
    font-size: 5cqw
}
}

@-moz-document url-prefix("https://www.zhihu.com/question/") {
.RichContent {
    container-type: inline-size;
    font-size: 5cqw
}
}

But it works incorrectly, since-- Is it impossible to use cpw on container itself?

I updated my code and it's working then:

@-moz-document url-prefix("https://www.google.com/search?q=") {
.g {
    container-type: inline-size
}
.g > div {
    font-size: 5cqw
}
}

@-moz-document url-prefix("https://www.zhihu.com/question/") {
.RichContent {
    container-type: inline-size
}
.RichContent-inner {
    font-size: 5cqw
}
}

In 3rd attempt I try to put repeating part to one place like:

@-moz-document regexp(".*") {
@container(min-width:1px) {
    :first-child {
        font-size: 5cqw
    }
}
}

@-moz-document url-prefix("https://www.google.com/search?q=") {
.g {
    container-type: inline-size
}
}

@-moz-document url-prefix("https://www.zhihu.com/question/") {
.RichContent {
    container-type: inline-size
}
}

Yes I understand it's not working correctly... How do I move on?

a_a
  • 37
  • 4

0 Answers0