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

fix(235) - Move open isolated #434

Merged
merged 4 commits into from
May 11, 2017
Merged

fix(235) - Move open isolated #434

merged 4 commits into from
May 11, 2017

Conversation

SaraVieira
Copy link
Collaborator

@SaraVieira SaraVieira commented May 9, 2017

  • Removes open isolated from preview

Fixes #235

Copy link
Member

@sapegin sapegin left a comment

Choose a reason for hiding this comment

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

Cool! That’s good enough for the start after some tweaks.

Next steps could be extraction of separate components: Toolbar, ToolbarButton (with link, with icon, with arrow), etc.

@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { MdFullscreen, MdFullscreenExit, MdArrowDropDown, MdArrowDropUp } from 'react-icons/lib/md';
Copy link
Member

Choose a reason for hiding this comment

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

I think we should import particular icon modules, otherwise we’ll have the whole library in the bundle. And wouldn’t rely on tree shaking in Webpack 2 ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I haven't had problems in importing like this but sure , I can divide this in 4 lines 👍

Copy link
Member

@sapegin sapegin May 9, 2017

Choose a reason for hiding this comment

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

Have you measured bundle size before and after? ;-|

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed 👍

cursor: 'pointer',
'&:hover, &:active': {
isolate: false,
'&:hover': {
Copy link
Member

Choose a reason for hiding this comment

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

Probably better to disable isolation then to repeat all properties if it doesn’t break anything.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

isolate: false what does this do ?

Copy link
Member

Choose a reason for hiding this comment

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

It disables jss-isolate. That’s why you have to copy styles from non-hover state when you don’t have isolate: false.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OHHHHHHHHHHHHHHHHHH

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added 👍

right: -1,
margin: 0,
padding: [[space[0], space[1]]],
outline: 'none',
Copy link
Member

Choose a reason for hiding this comment

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

If you disable default focus styles you need to provide some fallback to make it accessible with a keyboard.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will set a focus with the outline , good catch 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Outline added 👍

hideCode: {
composes: '$codeToggle',
backgroundColor: color.codeBackground,
toolbar: {
Copy link
Member

Choose a reason for hiding this comment

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

I’d use react-group here ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

react-group ? What do you mean ?

Copy link
Member

Choose a reason for hiding this comment

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

https://sapegin.github.io/react-group/ — we already use it in Styleguidist.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But why use react group ?

Copy link
Member

Choose a reason for hiding this comment

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

Because it’s easy and you could avoid this ugly selector with :not ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You don't like my css mastery ? :p

Copy link
Member

Choose a reason for hiding this comment

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

👻

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh , you made this, you selling me your stuff :p

@sapegin sapegin requested a review from okonet May 9, 2017 12:58
@sapegin
Copy link
Member

sapegin commented May 9, 2017

Should we use a branch for the new UI? I don’t want it to block other features and don’t want to release many small changes separately.

@SaraVieira
Copy link
Collaborator Author

@sapegin I think we should but maybe after this PR goes because this one actually closes an issue

@sapegin
Copy link
Member

sapegin commented May 9, 2017

This PR alone creates even more inconsistency with opening / closing isolation ;-|

@SaraVieira
Copy link
Collaborator Author

@sapegin I can add the same icon at the top , I tought it would be done in phases but I can dp that really quickly 😄

@sapegin
Copy link
Member

sapegin commented May 9, 2017

That’s why I want to use a branch, so we could iterate not in production ;-)

@SaraVieira SaraVieira changed the base branch from master to ui May 9, 2017 13:22
@SaraVieira
Copy link
Collaborator Author

I created a ui branch and it's pointed to there now 👍

@sapegin sapegin added this to the UI 2.0 milestone May 9, 2017
@codecov-io
Copy link

codecov-io commented May 9, 2017

Codecov Report

Merging #434 into ui will increase coverage by 0.01%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##               ui     #434      +/-   ##
==========================================
+ Coverage   94.28%   94.29%   +0.01%     
==========================================
  Files          82       82              
  Lines        1138     1140       +2     
  Branches      255      257       +2     
==========================================
+ Hits         1073     1075       +2     
  Misses         61       61              
  Partials        4        4
Impacted Files Coverage Δ
...omponents/ReactComponent/ReactComponentRenderer.js 100% <100%> (ø) ⬆️
...rc/rsg-components/Playground/PlaygroundRenderer.js 92.3% <87.5%> (+1.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update feaa6b8...538e891. Read the comment docs.

@SaraVieira
Copy link
Collaborator Author

SaraVieira commented May 9, 2017

Changes made @sapegin

screenshot 2017-05-09 21 58 43

<section className={classes.toolbar}>
<div>
<Group separator=" " className={classes.toolbar}>
<div className={classes.toolbarItem}>
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need a margin here? If space isn’t enough then react-group is not the best choice because now we’re mixing spaces (a real space) with margins.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried adding only the spaces and they were too close together and you could click one by accident

Copy link
Member

Choose a reason for hiding this comment

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

Then maybe add padding to the button instead of margin to increase clickable area?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The thing is I think it makes sense semantically ( not idea if that is spelled correctly) to have their own margins , that way when something is added it always has that margin associated

Copy link
Member

Choose a reason for hiding this comment

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

That’s a tough question ;-) I often keep margins and layout in a separate layer. So do whatever you prefer now and when we extract the button to a separate component we’ll talk again what to do ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a div with a class of toolbarItem arround the component to actually give the margin some abstration from the component :)

@sapegin sapegin merged commit 9164b59 into ui May 11, 2017
@sapegin sapegin deleted the fix/EC-235 branch May 11, 2017 12:00
@sapegin
Copy link
Member

sapegin commented May 11, 2017

I think it’s good enough for the very first iteration, merged, thanks! :shipit:

@SaraVieira
Copy link
Collaborator Author

🎉 🎉

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.

3 participants