picocss / pico

Minimal CSS Framework for semantic HTML
https://picocss.com
MIT License
13.58k stars 393 forks source link

Add additional css rules to address Nuxt and similar frameworks #222

Closed djmtype closed 2 years ago

djmtype commented 2 years ago

Nuxt v3 injects and requires a div#__nuxt added to the DOM directly following the body. The way Pico's max-width rules target head, main and footer is by using direct descenders. For example ,body > main.

Original:

@media (min-width: 768px) {
body > header,
body > main,
body > footer {
    max-width: 700px;
  }
}

While Nuxt contains this one descending div, Next contains two descending divs. To accommodate both frameworks, maybe:

@media (min-width: 768px) {
body > header, body > div[id] header,
body > main, body > div[id] main,
body > footer, body > div[id] footer {
    max-width: 700px;
  }
}
ja1den commented 2 years ago

This seems quite similar to my issue, #13.

djmtype commented 2 years ago

Same issue as #13

nuxodin commented 2 years ago

I find that too framework-specific. But the problem exists.

I could imagine the following solution: The good old [role="contentinfo"] is the old aria variant of "footer". With the difference that it should only be the main footer. And that is exactly what we want.

So instead of body > footer you could use [role="contentinfo"]...
The same applies to the header: [role="banner"] instead of body > header.

The disadvantage is that you have to mark the footer with an additional (redundant?) attribute.