Make CSS responsive to improve mobile layout#64
Merged
Conversation
Contributor
Author
Contributor
Author
|
@memowe Are you able to review this? |
Member
smith558
approved these changes
Apr 25, 2025
learnyouahaskell
approved these changes
Apr 25, 2025
Member
|
@Gabe-Mitnick I am not sure if the HTML generator is actually being used right now, we wanted to do something about it |
Collaborator
I'll try to have a detailed look tomorrow. :) |
This was referenced Nov 24, 2025
Closed
Merged
ulysses4ever
added a commit
to ulysses4ever/learnyouahaskell.github.io
that referenced
this pull request
Dec 8, 2025
ulysses4ever
added a commit
that referenced
this pull request
Dec 17, 2025
* Fix unmatched paragraph tags * Capitalize Higher Order Functions title consistently * Change apostrophes in text to curved closing quotes * Write ellipsis as ... in markdown and as single character in html * Write em dash as a single character in html * Adjust HTML whitespace to make automatic replacement easier * Replace single quotes with ' in code blocks * Replace double quotes with " in code blocks * Change double quotes in HTML text to curved double quote characters * Change " to literal double quote in inline code in 1 location * Replace raw characters with entities (e.g. <) in code blocks * Align use of no-break space U+00A0 and in markdown and HTML * Change <a name...> anchors to id attributes on h2 tags * Add id attributes to heading tags that do not have them * Change order of attributes in img tags * Delete px from img tag width and height attributes * Replace newline with space in img alt attributes * Change license link rel attribute from nofollow to license and adjust its position * Post-process pandoc output to add chapters class to chapter list * Change HTML chapter list to match markdown: remove enclosing paragraph and add type attribute * Add upper margin to chapter list to restore the spacing from the removed <p> tag * Change <b> and <em> tags to <strong> in HTML * Change <i> tags to <em> in HTML * Change hintbox tag from <p> to <div> in one location * Put <p> tag around contents of hintboxes * Change <span> tags to <code> and adjust CSS for inline code * Do all remaining changes to replace existing HTML with markdown-generated HTML * add github pages workflow Signed-off-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com> * CI: make github pages workflow regenerate HTML from Markdown Removed duplicate checkout action in deploy workflow. * change em -> strong on index.html to preserve original formatting * fix formatting of an error message * Adjust alignment of snippet * Adjust style to make sure that inline snippet are line breakable (line wrap) * remove generated files (including docs/*.html except index), clean up generate.sh, add .gitignore & Makefile * clean up assets: remove dup CSS, move top-level sh-scripts under sh/Scripts * responsive design for mobile (manually cherry-pick 7c5423a from #64) --------- Signed-off-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com> Co-authored-by: Gregory Cox <gcox_gcox@proton.me> Co-authored-by: Pier-Luc Caron St-Pierre <pierluc.caronstpierre@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before
On narrow viewports (e.g. a phone or a narrow window on desktop) the layout would break and there would be lots of horizontal scrolling and text spilling off the edge of the background

After
Responsive CSS keeps the layout nice on narrow viewports.

I also added a
lang="en"attribute to each html file because apparently that's good for accessibility, SEO, and hyphenation behavior.Remaining issues
One potential fix is to add a gradient fade-out that indicates to the user that there's more content that they can't see without scrolling, like this:


But I couldn't figure out a way to implement that properly without modifying the html generator to add an extra wrapper div around each code block. Another solution is to have the entire black block scroll side to side, which would look like this, but proper implementation for this would also require an extra wrapper div.
Despite these problems, though, I think this PR is strictly an improvement on the existing CSS.