-
Notifications
You must be signed in to change notification settings - Fork 509
feat: adds cursor interactive examples #597
Conversation
|
💖 Thanks for opening this pull request! 💖 |
wbamberg
left a comment
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 your contribution @brianlmacdonald !
I had a few comments. Also, I don't think this example belongs on its own in a cursor directory, I think it should live in basic-user-interface, as that's the spec it's defined in.
| .example-choice-list { | ||
| height: 500px; | ||
| width: 250px; | ||
| } |
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.
I don't think we should be adjusting the editor styles in this CSS (but actually, you don't need this anyway).
|
|
||
| .cursor { | ||
| display: flex; | ||
| background-color:#1766aa; |
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.
Should have a space here between the : and the value.
| width: 250px; | ||
| } | ||
|
|
||
| .cursor { |
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.
I'm not sure why we don't simply apply this CSS to #example-element.
| background-color:#1766aa; | ||
| color: white; | ||
| height: 100px; | ||
| width: 200px; |
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.
I'd suggest making this bigger, like 80% / 80%.
| justify-content: center; | ||
| align-items: center; | ||
| font-size: 14pt; | ||
| } |
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.
We use 4 spaces to indent (sorry not to have a style guide linked from the contribution docs).
| <button type="button" class="copy hidden" aria-hidden="true"> | ||
| <span class="visually-hidden">Copy to Clipboard</span> | ||
| </button> | ||
| </div> |
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.
We should restrict the number of choices to 6, to avoid scrolling. Which 6 values you pick is up to you, but try to choose a representative/commonly used set. I know it's hard in a case like this when there are so many values.
| <div class='cursor 'id="example-element">Mouse over to see cursor style</div> | ||
| </section> | ||
|
|
||
| </div> No newline at end of file |
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.
File should end with a newline.
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.
@wbamberg done and done. Thanks!
| <div id="output" class="output hidden large"> | ||
|
|
||
| <section id="default-example" class="default-example container"> | ||
| <div class='cursor 'id="example-element">Mouse over to see cursor style</div> |
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.
If you make the change I suggested in the CSS file you don't need this 'cursor' class.
| <div id="output" class="output hidden large"> | ||
|
|
||
| <section id="default-example" class="default-example container"> | ||
| <div class='cursor 'id="example-element">Mouse over to see cursor style</div> |
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.
In similar examples we end the sentence with a period and refer to the element explicitly, like: "Move over this element to see the cursor style."
|
@wbamberg would a eslint-config for mdn's style be something useful/helpful? If so I could try my hand at making one for you all. It could run as a precommit script and would probably make your review process a bit more streamlined. |
Yes, very! @schalkneethling , is there a style guide that @brianlmacdonald could use for this? |
wbamberg
left a comment
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.
Looks great @brianlmacdonald , just a couple of other things. There's an extra level of <div> nesting in the HTML, and the "cursor" directory and its contents should be removed now the example is in "basic-user-interface".
Thanks!
| @@ -0,0 +1,56 @@ | |||
| <section id="example-choice-list" class="example-choice-list" data-property="cursor"> | |||
| <div> | |||
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's an extra <div> here that should be removed.
| </button> | ||
| </div> | ||
|
|
||
| </div> |
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.
Here's the other end of that <div>.
| @@ -0,0 +1,11 @@ | |||
| #example-element { | |||
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.
You still need to remove these files under cursor.
wbamberg
left a comment
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.
This looks great.
It usually takes a couple of hours for the new page to be deployed, and I'll update MDN soon after that.
Thanks for your contribution @brianlmacdonald !
|
Congrats on merging your first pull request! 🎉🎉🎉 |
|
Wahoo! @wbamberg Let me know if you'd like me to open the Eslint-config as an issue. |
@wbamberg @brianlmacdonald So, there are a couple of things.
With all of that said, there is a couple of things I am doing at the moment over and above the above ;)
|
|
I just updated the page -> https://developer.mozilla.org/en-US/docs/Web/CSS/cursor |
Addresses #555
Adds cursor examples and a fun light blue div to mouse over, and in doing so, change your cursor's style.