Skip to content
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

[INFRA] fix draft rendering css on mobile or when browser window is narrow #889

Merged
merged 7 commits into from
Oct 6, 2021

Conversation

sappelhoff
Copy link
Member

@sappelhoff sappelhoff commented Oct 2, 2021

fixes #491

it's probably (I think) the nav__title element's background that needs to be changed --> BUT ONLY when the width of the browser is of a certain width or below, see screenshot from browser console (in Chrome):

image

I applied red color to nav__title but:

  1. this results in unwanted coloring on wide screens, see screenshot:
    image

  2. this gets overridden when the screen is narrow (or the browser window is made narrow), see the "strike-through" CSS from the first screenshot in this thread, ... and then what we want to be red is blue again.

So we somehow need to edit/customize the logic that kicks in for narrow browser windows --> and to have that add the red color.

EDIT: tried that via https://stackoverflow.com/questions/13979443/if-screen-resolution-is-less-than-x-append-css/13979463 in fc1f272 ... will revert if it doesn't work.


An alternative might be to set the colors via :root {}, see: https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#custom-colors

Comment on lines 9 to 12
/* See: https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#custom-color-schemes */
:root {
--md-primary-fg-color: #ff0000;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that works ... but it changes ALL previously blue text to red, including the links.

I think it's okay, ... and I think I've had enough fiddling with this for this Saturday.

WDYT @effigies ?

@sappelhoff
Copy link
Member Author

okay, that works! conditionally applying CSS when screens are narrow ... and preventing that to be overridden, using !important:

image

I think that's what we wanted originally and in #491 ... and it's better than the alternative solution from 1b5d2bc (and corresponding comment #889 (comment))

@effigies
Copy link
Collaborator

effigies commented Oct 2, 2021

Looks good on my phone. Haven't looked from a laptop.

Copy link
Collaborator

@Remi-Gau Remi-Gau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can on the different responsive designs options of my browser this looks good to me.

@sappelhoff sappelhoff merged commit b1df683 into bids-standard:master Oct 6, 2021
@sappelhoff sappelhoff deleted the fix/css/nav branch October 6, 2021 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Draft styling incomplete on mobile
3 participants