Skip to content

Make test your skills boilerplate more consistent #40447

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

chrisdavidmills
Copy link
Contributor

Description

As per the following comments:

This PR attempts to make all the "test your skills" boilerplate a bit more consistent.

This is quite a lot to review, so apologies, but it should be a matter of looking at a few to make sure the boilerplate looks OK, and then skimming the live pages to make sure nothing looks broken.

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested review from a team as code owners July 19, 2025 17:20
@chrisdavidmills chrisdavidmills requested review from wbamberg and removed request for a team July 19, 2025 17:20
@github-actions github-actions bot added Content:WebAPI Web API docs Content:Learn Learning area docs labels Jul 19, 2025
@chrisdavidmills chrisdavidmills requested review from bsmth and removed request for a team and wbamberg July 19, 2025 17:20
@github-actions github-actions bot added the size/l [PR only] 501-1000 LoC changed label Jul 19, 2025
Copy link
Contributor

github-actions bot commented Jul 19, 2025

Preview URLs (34 pages)
Flaws (3)

Note! 33 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Learn_web_development
Title: Learn web development
Flaw count: 3

  • unknown:
    • No generic content config found
    • no blog root
    • no blog root
External URLs (3)

URL: /en-US/docs/Learn_web_development
Title: Learn web development


URL: /en-US/docs/Learn_web_development/Core/CSS_layout/Test_your_skills/Responsive_design
Title: Test your skills: Responsive web design and media queries

(comment last updated: 2025-07-22 12:55:08)

@@ -24,7 +22,7 @@ To complete the task:

> [!CALLOUT]
>
> You can also [download the starting point for this task](https://github.com/mdn/learning-area/blob/main/accessibility/tasks/html-css/css/css-a11y1-download.html) to work in your own editor or in an online editor.
> You can also [download the starting point for this task](https://github.com/mdn/learning-area/blob/main/accessibility/tasks/html-css/css/css-a11y1-download.html) to work in your own editor or in an online editor (such as [CodePen](https://codepen.io/) or [JSFiddle](https://jsfiddle.net/)).
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 need these callouts if you can copy-paste from the code blocks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did wonder about this. We currently have two styles of callout in play:

  1. This type, in which the reader is encouraged to download the complete starter file from the learning-area repo.
  2. The other type, in which the reader is encouraged to copy-paste from the code blocks.

It would be great to just use one style. Using the latter means that we have to maintain fewer files on the external repo. However, it does have two disadvantages:

  1. We have to show all the hidden blocks of code in the articles; otherwise, those bits can't be copy-pasted.
  2. This would mean only providing access to the HTML body, rather than the whole starter file. The user would then need to put that into a starter template file before using it.

What are your thoughts? Which one would you prefer?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah it's a good question. I'm in favor of the second option. Clicking "Play" expands to show everything used to make the live sample, and you have an editor there so this solves a few issues with the other approach. I feel like we might be able to describe this once somewhere in the Learn area ("test your skills" hints) and link to it in the note at the top where we say:

To get help, see hints for solving MDN tests or reach out to us in one of our communication channels.

What do you think? We could have a page about all of these in /Learn_web_development#skills_tests or /Learn_web_development/skills_tests that will make a lot less duplicate hints and info.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a great idea! I've added a section in 6b87ea3.

Is this what you had in mind? I can see us linking to this and then being able to remove loads of boilerplate from the individual articles.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah this looks really good, I think that will be a lot cleaner on the "test your skills" pages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I've updated all the articles to link to the new usage guide and removed all the repetitive stuff that we no longer need. Let me know what you think.

@github-actions github-actions bot removed the Content:WebAPI Web API docs label Jul 21, 2025
@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Jul 22, 2025
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added size/xl [PR only] >1000 LoC changed and removed size/l [PR only] 501-1000 LoC changed labels Jul 22, 2025
@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Jul 22, 2025
@chrisdavidmills chrisdavidmills requested a review from bsmth July 22, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Learn Learning area docs size/xl [PR only] >1000 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants