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

Adds a block formatting context to the preview div so that any floate… #773

Merged

Conversation

roblevintennis
Copy link
Contributor

@roblevintennis roblevintennis commented Jan 11, 2018

Addresses issue: #772

@sapegin I looked for a place to add a spec e.g. src/rsg-components/Playground/Playground.spec.js but I didn't see anything else asserting on CSS things in there so I deemed this not a thing that needed specs. Please advise if otherwise. That said, Here are some screenshots to make this PR crystal clear…

Nothing broke:

image

Proof .. floated button gets contained (note I added the float: right manually in devtools):

image


Here's the preview div with block formatting context rules applied:

image


Lmk if there's anything else you'd like done here. Thanks

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.

Thanks!

@@ -11,6 +11,8 @@ export const styles = ({ space, color, borderRadius }) => ({
padding: space[2],
border: [[1, color.border, 'solid']],
borderRadius,
width: '100%',
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 add a comment that it's a clearfix and why we need it here, otherwise these two lines will be eventually removed during refactoring ;-)

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 ok, cool will do

@sapegin
Copy link
Member

sapegin commented Jan 11, 2018

I didn't see anything else asserting on CSS things

For that we’ll need something like Cypress which would be awesome ;-)

…ormatting context and to contain any floated components.
@roblevintennis
Copy link
Contributor Author

roblevintennis commented Jan 11, 2018

@sapegin I added comments in a34b15b ... not sure what your line length rules are but I couldn't think of any shorter way to express .. lmk if it's making lines too long 😋 I could always remove the "block formatting context" since contain floats is self evident. Just lmk

@sapegin
Copy link
Member

sapegin commented Jan 11, 2018

I think it requires too much knowledge to understand and more about how then why. I’d add more generic comment on top of these two lines, explaining what’s the problem this code is solving.

@roblevintennis
Copy link
Contributor Author

well taken ... I tried to shorten comment and speak more to the issue being solved and not the mechanics of fix per your suggestion. Hopefully what you're looking for but lmk if you have something better :)

@sapegin sapegin merged commit ae960ca into styleguidist:master Jan 12, 2018
@sapegin
Copy link
Member

sapegin commented Jan 12, 2018

Thanks, merged!

@sapegin sapegin added this to the 6.2.0 milestone Jan 12, 2018
@roblevintennis
Copy link
Contributor Author

👍 thank you!

@roblevintennis roblevintennis deleted the contain_floats_in_component_boxes branch January 12, 2018 18:14
sapegin added a commit that referenced this pull request Jan 21, 2018
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](#662) by @SaraVieira)
* Allow descriptions for sections ([#743](#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](#749), part of [#750](#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](#738))
* Fix color issue in Safari ([#739](#739))
* Allow overriding of renderer-only components ([#710](#710))
* Do not overflow floated elements in examples (#772, [#773](#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](#742))
sapegin added a commit that referenced this pull request Jan 21, 2018
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](#662) by @SaraVieira)
* Allow descriptions for sections ([#743](#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](#749), part of [#750](#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](#738))
* Fix color issue in Safari ([#739](#739))
* Allow overriding of renderer-only components ([#710](#710))
* Do not overflow floated elements in examples (#772, [#773](#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](#742))
sapegin added a commit that referenced this pull request Jan 21, 2018
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](#662) by @SaraVieira)
* Allow descriptions for sections ([#743](#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](#749), part of [#750](#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](#738))
* Fix color issue in Safari ([#739](#739))
* Allow overriding of renderer-only components ([#710](#710))
* Do not overflow floated elements in examples (#772, [#773](#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](#742))
artem0723 pushed a commit to artem0723/React-Styleguidist that referenced this pull request Oct 28, 2021
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](styleguidist/react-styleguidist#662) by @SaraVieira)
* Allow descriptions for sections ([#743](styleguidist/react-styleguidist#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](styleguidist/react-styleguidist#749), part of [#750](styleguidist/react-styleguidist#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](styleguidist/react-styleguidist#738))
* Fix color issue in Safari ([#739](styleguidist/react-styleguidist#739))
* Allow overriding of renderer-only components ([#710](styleguidist/react-styleguidist#710))
* Do not overflow floated elements in examples (#772, [#773](styleguidist/react-styleguidist#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](styleguidist/react-styleguidist#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](styleguidist/react-styleguidist#742))
artem0723 pushed a commit to artem0723/React-Styleguidist that referenced this pull request Oct 28, 2021
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](styleguidist/react-styleguidist#662) by @SaraVieira)
* Allow descriptions for sections ([#743](styleguidist/react-styleguidist#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](styleguidist/react-styleguidist#749), part of [#750](styleguidist/react-styleguidist#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](styleguidist/react-styleguidist#738))
* Fix color issue in Safari ([#739](styleguidist/react-styleguidist#739))
* Allow overriding of renderer-only components ([#710](styleguidist/react-styleguidist#710))
* Do not overflow floated elements in examples (#772, [#773](styleguidist/react-styleguidist#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](styleguidist/react-styleguidist#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](styleguidist/react-styleguidist#742))
artem0723 pushed a commit to artem0723/React-Styleguidist that referenced this pull request Oct 28, 2021
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](styleguidist/react-styleguidist#662) by @SaraVieira)
* Allow descriptions for sections ([#743](styleguidist/react-styleguidist#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](styleguidist/react-styleguidist#749), part of [#750](styleguidist/react-styleguidist#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](styleguidist/react-styleguidist#738))
* Fix color issue in Safari ([#739](styleguidist/react-styleguidist#739))
* Allow overriding of renderer-only components ([#710](styleguidist/react-styleguidist#710))
* Do not overflow floated elements in examples (#772, [#773](styleguidist/react-styleguidist#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](styleguidist/react-styleguidist#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](styleguidist/react-styleguidist#742))
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.

None yet

2 participants