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

Style & layout improvements #126

Merged
merged 18 commits into from
Oct 14, 2021
Merged

Style & layout improvements #126

merged 18 commits into from
Oct 14, 2021

Conversation

robyngit
Copy link
Member

@robyngit robyngit commented Oct 12, 2021

Remove repeated layout code (make DRY)

In order to facilitate changing the CSS for these layouts

  • Combine all of the similar list.html layouts into one
  • Combine all of the cards partial templates into one - use this template in the homepage
  • Combine the data-banner and sub-goals partials into one cardsTitle partial
  • Fix cards template to use proper BEM conventions (no grandchild elements; elements with modifier classes should also have the main class to avoid repeating style rules in the scss)
  • Change some HTML tags to the semantic version in layouts
  • Consolidate button shortcodes. Delete buttons code, use two button codes instead.

Improvements to Index (Home Page)

  • Make text on homepage configurable from markdown
  • Make sections and section headers, boxes, and text work on both small and large screens
  • Use semantic HTML tags + BEM conventions in layout
  • Remove unused CSS styles
  • General style improvements (make more similar to original homepage)

Make the default 3-column layout work on mobile

  • Move left, right, center col styles to the layout style sheet since they use the same variables and styles are dependent on one another
  • Fix the full-page container style used in the 3-col layout. Add a full-width container as well.
  • Move the navigation that is normally on the right-hand side; as well as the logo + "Overview" text, above the main content on mobile screens

Make the cards template work on mobile

  • Cards will switch between a 3 and 2 col layout when screen re-sizes, and each card's width is somewhat flexible

Misc. responsive enhancements

  • Make header text fit on mobile screens
  • Fix padding issue with scores globe
  • Align breadcrumb with rest of content

Improve general styles; clean up CSS files

  • Remove unused CSS style rules and files
  • Fix issue where the controls for the globe viz were overlapping the nav on mobile
  • Style the right-side nav
  • Tweak some misc styles
  • Enable emojis
  • Add styles to all the common markdown tags (mostly for content rendered from markdown, which has no classes)
  • Make the csvTable styles the general table style
  • Consolidate similar buttons styles used throughout the website into one single 'button' class

- Move left, right, center col styles to the layout style sheet since they use the same variables and styles are dependent on one another
- Fix the full-page container style used in the 3-col layout. Add a full-width container as well.
- Make the 3-col layout work on smaller screens
- Remove unused CSS styles
- Fix issue where the controls for the globe viz were overlapping the nav on mobile
- Style the right-side nav
- Tweak some misc styles

Relates to  #103, #17, #28, #67, #93
- Combine all of the list.html layouts into one where possible (make DRY)
- Combine all of the cards partial templates into one
- Combine the data-banner and sub-goals partials into one cardsTitle partial
- Fix cards template to use proper BEM conventions
- Make the cards template work on all screen sizes
@robyngit robyngit linked an issue Oct 13, 2021 that may be closed by this pull request
- Use the term 'boxes' to avoid confusion and class mix-ups with the cards partial
- Use BEM conventions. Make 'white' the default class, 'blue' the modifier class.

Relates to #28
- Make sections and section headers responsive on index page
- General style improvements to homepage (make more similar to original homepage)
- Use semantic HTML tags + BEM conventions in index layout
- Remove unused CSS styles
- Rename cardsTitle layout to cards-title to be consistent with other filenames
- Configure canonical urls (might help with images in demo site?)

Relates to #28, #17, #103
Try to fix the issue with images not appearing on demo site
robyngit added a commit that referenced this pull request Oct 13, 2021
Temporarily - to demo style changes made in PR #126
To try and trigger the GH workflow
Temporarily - to demo style changes made in PR #126
- Links, images, and fonts not being referenced correctly on deployed demo
- Try and fix issue with fonts not showing up in the /OHI-science/ demo
- Enable emojis
- Add styles to all the common markdown tags (mostly for content rendered from markdown, which has no classes)
- Change some HTML tags to the semantic version in layouts
- Make the csvTable styles the general table styles
- Remove some CSS styles that were not needed

Relates to #67, #28, #103
@Melsteroni
Copy link
Collaborator

@bshalpern (aesthetic changes that look different from https://ohi-science.org/OHI-website vs. http://probable-cattle.nceas.ucsb.edu/)

The changes all seem good to me. The only issue I noticed was that the left margin on the "Scores by Country" tab seem to small on my browser/screen. This is what I see:
image

@bshalpern
Copy link

bshalpern commented Oct 14, 2021 via email

- Make header text fit on mobile screens
- Align breadcrumb with rest of navigation
- Consolidate similar buttons styles used throughout the website into one single 'button' class
- Consolidate button shortcodess. Delete buttons code, use two button codes instead.

Relates to #117, #28, #17, #103
@robyngit robyngit linked an issue Oct 14, 2021 that may be closed by this pull request
@robyngit robyngit mentioned this pull request Oct 14, 2021
- Make sure that legend doesn't extend beyond edge of screen

Relates to #17
- Instead, the cards template will look for a cards_text property in the page.
- Add page_description to the two data sub-pages.

Relates to #125
@robyngit robyngit mentioned this pull request Oct 14, 2021
- The icons were not being displayed on the demo page
Copy link
Member

@ThomasThelen ThomasThelen left a comment

Choose a reason for hiding this comment

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

These are awesome changes and the site is going to totally benefit from these!

@ThomasThelen ThomasThelen merged commit de23d3f into main Oct 14, 2021
@ThomasThelen ThomasThelen deleted the css_refactor branch October 14, 2021 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants