Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pagedjs
pagedjs
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 161
    • Issues 161
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 12
    • Merge Requests 12
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Tools
  • pagedjspagedjs
  • Merge Requests
  • !122

Merged
Opened Jun 07, 2020 by Nellie McKesson@nelliemckesson
  • Report abuse
Report abuse

Adding handling for nth-of-type selectors

I got some initial handling for nth-of-type selectors working in this branch. I ended up going a route similar to what @julientaq suggested (parsing the CSS and then adding new attributes to selected elements). It actually seems to be working well (though I ought to write a spec for it, and check out why the pipeline is failing), but I have a few questions for @fchasen re: code conventions and architecture:

  1. Am I adding the new CSS rules in the correct location (polisher.styleSheet)?
  2. Should I use a new classname, instead of a custom attribute? (I just want to make it easy to keep the source content separate from stuff added by paged.)
  3. Should I set the attribute name to something more human readable? (Just using a UUID right now...)
  4. Should this go into a new module? It's not really "paged-media"-specific, but I wasn't sure where else in the folder structure that it might belong.

Any other notes or things you'd do differently?

Edited Jun 12, 2020 by Nellie McKesson

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://gitlab.pagedmedia.org/nelliemckesson/pagedjs.git nellie/nthOfType
git checkout -b nelliemckesson/pagedjs-nellie/nthOfType FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff nelliemckesson/pagedjs-nellie/nthOfType

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 2
  • Commits 8
  • Pipelines 8
  • Changes 8
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: tools/pagedjs!122

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.