-
Notifications
You must be signed in to change notification settings - Fork 517
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(css): update 'display' interactive demo #2710
Conversation
This is close. But I think the additional text in the example does not fully clarify the element on which Brainstorming an idea here. How about we add a description outside the
With Let me know what you think. |
@dipikabh Yes, we need to be more explicit. |
Co-authored-by: Estelle Weyl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @dipikabh I'll let you merge both PRs at the same time if this PR is ok with you.
<div id="output" class="output large hidden"> | ||
<section id="default-example" class="default-example"> | ||
<div class="example-container"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we need to be more explicit.
@OnkarRuikar, should we add this then:
<div id="output" class="output large hidden"> | |
<section id="default-example" class="default-example"> | |
<div class="example-container"> | |
<div id="output" class="output large hidden"> | |
<p>The <code>display</code> property is set on the <code>div</code> element enclosed by the orange dashed border. | |
You can apply different <code>display</code> values on this element to observe their effects on its layout | |
in relation to adjacent elements. | |
Note that this element contains three child <code>div</code> elements. | |
<section id="default-example" class="default-example"> | |
<div class="example-container"> |
This is how it would look:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OnkarRuikar I didn't realize you opened another PR to add the statement :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that PR is in mdn/content
.
I have not noticed other instances where we discuss or refer to the "Try it" demo examples in content.
It might be best to keep the interactive demo examples self-contained. Let me know what you think - we can close mdn/content#31672 and instead make the explanatory updates (as suggested above) to the code within this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dipikabh that's too much text in the output. On narrow screens, readers will have to scroll to see the actual target div.
I have not noticed other instances where we discuss or refer to the "Try it" demo examples in content.
We do have some "Try it" sections with pros, e.g. https://developer.mozilla.org/en-US/docs/Web/CSS/max#try_it
In the mdn/content
PR we can put the text below the macro call. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's pic the shortest version Apply different <code>display</code> values on the dashed orange-bordered <code>div</code>, which contains three child elements.
bef7553
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvements, @OnkarRuikar!
Done 👍 |
Thanks! FWIW I agree with @dipikabh that we should try very hard to keep interactive examples self-contained. And that really any kind of exposition in the examples is unfortunate, but sometimes as in this case it is unavoidable (as also for instance here: https://developer.mozilla.org/en-US/docs/Web/CSS/position). But I think what you have here is perfect :). |
Screenshot