-
Notifications
You must be signed in to change notification settings - Fork 3
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
[WIP] WSO 2020 Summer Redesign #96
Open
walnutdust
wants to merge
48
commits into
master
Choose a base branch
from
design-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
…act into design-update
…into design-update
* First pass at profile update * more edits * First pass at ephmatcher * First pass * Fixed redirect link * Save * Updated modals * Ephmatch draft
…into design-update
…into design-update
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.
WSO 2020 Summer Redesign
Last Updated June 23
This document contains helpful information, notes, and guidelines for updating the codebase moving forward. Please read through this document at least once before embarking on making any changes. This document will be periodically updated to provide more information.
We will be using Elastic UI for React components, and SASS with CSS modules for additional styling.
The Figma file can be found here
Table of Contents
Getting Started
The
design-update
and respectivedesign/<service>
branches have been prepared with the necessary assets and libraries for this update. We will be using thedesign-update
branch as the base branch for the design updates.First, choose a service to work on:
Comment below, or PM me to choose a service to work on, and I will add your name above. From your command line, navigate to the
wso-react
folder, and perform the following commands, replacing<service>
with the name of the service you are working on (e.g.facebook
):See troubleshooting if there are errors.
Once everything is working as expected, navigate to
src/index.js
, and uncomment line 10 while commenting out line 11.Before:
After:
This basically strips out all additional formatting from the old stylesheet - now it's up to us to create all the styles from scratch :) When working on your service, work within the white areas for now - i.e. someone else will be in charge of dealing with the navigation bar and footer.
Project Structure
Components are located in individual folders, by function, in
src/components
. Each component/view will have it's own individual folder, and it is where the style sheet folder should belong as well.EUI
Elastic UI is a React component library, and using component libraries allow us to easily iterate on designs while ensuring that the components are responsive, well-tested, and promote best accessibility practices.
Note that you don't have to use Elastic UI from start to end (e.g. there is no need to make every single component an Elastic UI component). Certain parts of design and layout might be easier dealt with by creating customized
div
s, and over time you'll learn to make the judgement call :)SASS
To help out with additional styling, we will be using SASS (Synthetically Awesome Style Sheets), which is a superset of CSS and provides many additional useful features - a quick guide can be found here. SASS provides a cleaner syntax for CSS variables, nested syntax, and mixins, all of which help make it easier for us to create and adhere to a consistent theme.
You might also notice that some of the styling files have the file type
.module.scss
- this is a feature from CSS modules, which allow us to essentially import styles without the worry of conflicting with a different stylesheet. For example, If you have a.btn
class in one stylesheet, and a.btn
class in another stylesheets, when both of them are imported into your website, they are resolved in the order of imports, which can be confusing especially if they were important in separate files and it's up to the bundler/builder to decide how to place things together. This risk of confusion greatly increases with the project size, and people might accidentally create rules that ruins the styling in another part of the project.Or, as the joke goes, "Two CSS rules walk into a bar. A bar stool in a completely different bar falls over."
SCSS Modules are used like this,
As with the normal import syntax, it can also be done like:
although you will have to be more careful when you use this method to avoid name conflicts.
Design Flow
Once you have chosen a project, you should be referencing the respective Figma file in your designs, and sticking to it where possible!
To help you with this, here are some tips:
src/components/theme.scss
. The figma designs should be based on these values, so use these variables wherever possible.As always, feel free to use me as a resource or to bounce ideas off of me if it is helpful :)
Guidelines
Here are some guidelines when modifying the repository and keep things in good health. Not all of the code is held up to these standards, but with your effort we can make the code base healthier and easier for everyone to use!
FAQ
Re-write it. Mercilessly. Most of the code was done fresh out of learning React, and the code quality is inconsistent in some spots. Clarify with me if you have any doubts, but otherwise believe that you should be in a good spot to know when code looks good or bad :)
Troubleshooting
git pull
does not allow me to pull the branches.This error is caused by conflicting branch names. Simply run
git remote prune origin
.git checkout design/<service>
does not allow me to check out the correct branchyarn start
gives me a "Cannot find module 'xxx'" errorRemove
node_modules
and reinstall the packages!This error is caused by having a branch called
design
in your local repository. Simply rungit branch -D design
.