Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • pagedjs pagedjs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 204
    • Issues 204
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pagedjs
  • pagedjspagedjs
  • Issues
  • #352

Closed
Open
Created Oct 20, 2021 by Boris Budini@kominoshja🛡Owner

Sibling (+) selectors don't work as expected

I've encountered a weird css rendering bug where styles applying to sibling selectors aren't being applied correctly.

Example CSS:

.section {
  color: red;
}
.chapter + .section {
  color: blue;
}

Example HTML:

<h3 class="section">This is red</h3>
<p>...Some text...</p>

<h2 class="chapter">...Some title...</h2>
<h3 class="section">This should be blue, but renders red</h3>

The second section title renders blue only when I add an !important declaration.

.chapter + .section {
  color: blue !important;
}

I've tried to increase the specificity (i.e. .chapter[class] + .section[class]) and juggle the order of the styling blocks to no avail.

BTW, this applies to all CSS properties — not only color.

Version affected

I'm using pagedjs@0.2.0 and pagedjs-cli@0.1.6

Edited Oct 20, 2021 by Boris Budini
Assignee
Assign to
Time tracking