-
Notifications
You must be signed in to change notification settings - Fork 142
Fix hidden list numbering #2689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1. List are now left aligned. This ensures that the list numbering is not hidden by custom css style rules and also preserves the indentation of the list elements so that they are reasonably small enough for mobile users.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2689 +/- ##
========================================
Coverage 52.80% 52.80%
========================================
Files 130 130
Lines 7162 7162
Branches 1503 1480 -23
========================================
Hits 3782 3782
- Misses 3075 3225 +150
+ Partials 305 155 -150 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Here's a side by side comparison of the effect of changing this style:
Left - New (this PR), Right - Old (master-netlify) While this fix does indeed solve the issue, I wonder if there is a more stylish way to go about it, as it does increase the indentation substantially... |
This is likely due to the |
|
@gerteck I have updated the css style to retain the original positioning for unordered lists. |
|
Thanks for the quick change! Does anyone else have any opinions on the increased indent on the numbered lists? |
|
This seems more like a user issue that doesn't need a markbind fix. I see that the main.css in the 2103 website has .website-content {
margin: 12px auto 40px auto;
max-width: 800px;
overflow: hidden;
text-align:justify
}which is not contained in our default main.css. The wrapper we provide (for similar effect) is #content-wrapper {
flex: 1;
margin: 0 auto;
min-width: 0;
max-width: 1000px;
overflow-x: auto;
padding: 0.8rem 20px 0;
transition: 0.4s;
}@damithc Adjusting (or removing entirely) the |
I tried this and it fixed the problem in the list. Thanks for the tip @tlylt 💯 Soon I will try replacing the |
Why do we need to remove the padding defined in main.css? |
I was thinking maybe in a case where authors define their own layouts but did not add any padding. With |
In my opinion it's a known risk that styles might break if users choose to update the default css, any other styling might also break if done incorrectly. Not that there's no need to improve the feature itself, but the approach this PR is going for doesn't resolve the problem nicely without introducing "new problems":
|
- Changed ordered list to use browser's table layout
I agree that keeping styling outside should be preferred as it keeps the alignment of the list elements. Perhaps we can add it as a known issue/ warning to users who are trying to insert custom css stylesheets into their documents? I also came across this thread on stack overflow where the accepted answer suggested using the browser's table layout algorithm to achieve the same effect. I've tried it out and it does preserve the outside property and keeps the indentation while avoiding the hidden list numbers. I have not found any regressions yet. Have yet to test it out on macOS. @tlylt what do you thhink? I have pushed the commit if you want to try it out. |
i don't see any mention of how custom css can be used in our UG, perhaps we can add some details of that (and the potential pitfalls) in https://markbind-master.netlify.app/userguide/usinghtmljavascriptcss Regarding the new proposed changes, I have a preference to keep the current simple version as is since the existing layout css works well enough, but thanks @Incogdino for the investigation and finding out the root cause🚀 |
Okay in that case I shall close this PR and raise an issue to update the documentation |









What is the purpose of this pull request?
Closes #2628
Overview of changes:
Updated markbind default list css property
list-style-positionfromoutsidetoinside. This causes the list numbering to be inside the block box rather than outside the block box. More information hereAnything you'd like to highlight/discuss:
The downside(maybe) to this would be that certain list numbering will be slightly misaligned as the number of elements in the list increases. For instance, from number 9 to number 10, the start of content isn't aligned vertically.
Screenshot of the CS2103 website on my macOS:

Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Update list css
not hidden by custom css style rules and also preserves the
indentation of the list elements so that they are reasonably small
enough for mobile users.
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major,r.Minor,r.Patch.Breaking change release note preparation (if applicable):