Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Conversation

@brianlmacdonald
Copy link
Contributor

Addresses #555

Adds cursor examples and a fun light blue div to mouse over, and in doing so, change your cursor's style.

@welcome
Copy link

welcome bot commented Feb 20, 2018

💖 Thanks for opening this pull request! 💖
Here is a list of things that will help get it across the finish line: - If this is a new or updated CSS interactive example, please ensure that you followed the CSS styleguide - If this is a new or updated JavaScript interactive example, please ensure that you followed the JavaScript styleguide - If your changes affects any of the steps in our contribution docs, please also make the relevant changes there.

Copy link
Contributor

@wbamberg wbamberg left a 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;
}
Copy link
Contributor

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;
Copy link
Contributor

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 {
Copy link
Contributor

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;
Copy link
Contributor

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;
}
Copy link
Contributor

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>
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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>
Copy link
Contributor

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>
Copy link
Contributor

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."

@brianlmacdonald
Copy link
Contributor Author

@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.

@wbamberg
Copy link
Contributor

would a eslint-config for mdn's style be something useful/helpful?

Yes, very! @schalkneethling , is there a style guide that @brianlmacdonald could use for this?

Copy link
Contributor

@wbamberg wbamberg left a 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>
Copy link
Contributor

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>
Copy link
Contributor

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 {
Copy link
Contributor

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.

Copy link
Contributor

@wbamberg wbamberg left a 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 !

@wbamberg wbamberg merged commit 59cba29 into mdn:master Feb 21, 2018
@welcome
Copy link

welcome bot commented Feb 21, 2018

Congrats on merging your first pull request! 🎉🎉🎉

@brianlmacdonald
Copy link
Contributor Author

Wahoo! @wbamberg Let me know if you'd like me to open the Eslint-config as an issue.

@schalkneethling
Copy link

Yes, very! @schalkneethling , is there a style guide that @brianlmacdonald could use for this?

@wbamberg @brianlmacdonald So, there are a couple of things.

  1. The eslintrc for this project - https://github.com/mdn/interactive-examples/blob/master/.eslintrc.js
  2. The eslintrc for Kuma(MDN Web Docs) - https://github.com/mozilla/kuma/blob/master/.eslintrc.js
  3. And then there is a code styleguide in the works here that will also cover all these things.

With all of that said, there is a couple of things I am doing at the moment over and above the above ;)

  1. Merging the eslintrc from Kuma and the interactive examples
  2. Ensure that both projects have a pre-commit hook that lints the relevant JS
  3. As soon as this PR[1] is merged, I am going to decouple the build tool from this project. One of the first items on the list to improve the builder to lint the example JS and CSS when pages are built so things are flagged at dev/build time.

@wbamberg
Copy link
Contributor

I just updated the page -> https://developer.mozilla.org/en-US/docs/Web/CSS/cursor

@wbamberg wbamberg mentioned this pull request Feb 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants