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

PCD-1309 Fix/css refactor 2 #326

Merged
merged 12 commits into from
Aug 6, 2018
Merged

PCD-1309 Fix/css refactor 2 #326

merged 12 commits into from
Aug 6, 2018

Conversation

qingyashu
Copy link
Contributor

No description provided.

@qingyashu qingyashu force-pushed the fix/css-refactor-2 branch from 4a0fc27 to 2708f41 Compare August 2, 2018 18:51
@qingyashu qingyashu force-pushed the fix/css-refactor-2 branch from fdb16a7 to 8bfcab7 Compare August 3, 2018 19:32
</button>
</ToggleButton>
<div className="data-model-graph">
<button
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to add the styles from ToggleButton?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ToggleButton only has 2 css attribute top and left, They don't have any effect for the button in this page so I directly remove them

.explorer-component {
display: flex;
padding: 40px 0;
background-color: #ecebeb;
Copy link
Contributor

Choose a reason for hiding this comment

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

where did this color come from?

<LoginFrame>
<LeftBox style={{ height: `${this.state.height}px` }}>
<div className="login-page">
<div className="login-page__side-box">
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need the height that was being passed to LeftBox?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

height is not used, so removed.

@@ -61,7 +52,6 @@ export function intersection(aList, bList) {
* @param history from react-router
* @param match from react-router.match
* @param public default false - set true to disable auth-guard
* @param background passed through to <Box background> wrapper for page.jsx-level background
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this param for anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did some global searching, and found that background-color is only different for ExplorerComponent and was passed via background variable. So to make code cleaner I set background-color inside ExplorerComponent.less, and remove this background parameter from ProtectedContent component.

Copy link
Contributor

Choose a reason for hiding this comment

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

awesome, makes sense to me

<NavLogo>
<div className="nav-bar">
<header className="nav-bar__header">
<nav className="nav-bar__nav nav-bar__nav--left">
Copy link
Contributor

Choose a reason for hiding this comment

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

it doesn't look like nav-bar__nav is a class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😆 Ah I am really bad at naming! how about nav-bar__content, nav-bar__content--left...

Copy link
Contributor

Choose a reason for hiding this comment

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

the name is fine, I just didn't see the class anywhere in the .less file


.nav-bar__nav--right .nav-bar__link {
border-left: 1px solid #d1d1d1;
&:last-child {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we unnest 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I will unnest .nav-bar__nav--right .nav-bar__link.
But I think it is reasonable to nest pseudo class names like :hover or :active because they only effect element itself and won't cause any side effects. Can we keep them?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah I get that, but it doesn't don't adhere to the BEM rules, and also doesn't give us the preprocessor speed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are right about preprocessor speed, That's a good reason!
Also if we want to have csslint in future then we should clean all & first (will be in next pr)
But I think BEM rule still allow reasonable nesting cases like this one: http://getbem.com/faq/#block-modifier-affects-elements

display: inline-block;
text-align: center;
opacity: 0.8;
&:hover {
Copy link
Contributor

Choose a reason for hiding this comment

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

unnest

@@ -0,0 +1,32 @@
.top-bar {
width: 100%;
background-color: #3283c8;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is @blue


.top-bar__link {
border-right: 2px solid #6896c6;
&:last-child {
Copy link
Contributor

Choose a reason for hiding this comment

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

unnest

{ GA.init(gaTracking, dev, gaDebug) && <RouteTracker /> }
<ReduxTopBar />
<ReduxNavBar />
<Box background={background} style={{ width: '100%', margin: 'auto' }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens with this background prop? should we get rid of the variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See comments in src/Login/ProtectedContent.jsx, I think this background variable was not a good design, think we better get rid of it.

Copy link
Contributor

@abgeorge7 abgeorge7 left a comment

Choose a reason for hiding this comment

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

Actually I just noticed that the top bar home button styling is wrong on hover.

Your branch shows blue text, master shows black text with orange underline

@qingyashu
Copy link
Contributor Author

Thanks for reminding me!! color fixed~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants