Skip to content

Add CSS tools to css-examples #45

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

Merged
merged 2 commits into from
Aug 12, 2021
Merged

Add CSS tools to css-examples #45

merged 2 commits into from
Aug 12, 2021

Conversation

wbamberg
Copy link
Contributor

@wbamberg wbamberg commented Aug 10, 2021

@rachelandrew , @Rumyra , I'd love your feedback on this PR.

We currently have a few pages in the CSS docs that are self-contained tools:

I think these are useful pages, but they are implemented as live samples. Live samples are really intended to be example code that can also be executed, so the reader can see the code but also see the result of it. These pages use that mechanism but hide all the code and implement a tool's UI in the live sample code.

This makes them really hard to maintain, because the code is treated like content. For example, < has to be escaped, and the code lives in one giant HTML file inside <pre> blocks.

If we want to keep these tools, the best solution I think would be for them to be part of Yari. But as a quicker fix that still helps quite a lot, we could keep them as GitHub pages - then they are more like code, so it should be at least possible to work on them.

I've had this in mind for a while but the final straw was that they are broken in the Markdown conversion (mdn/content#7779). We could perhaps fix it, or leave them as HTML (since they're not very editable anyway), but I thought a better solution would be this. It turned out to be really easy to do.

But I'm not sure how this aligns with the general policy of this repo, so I'd love feedback.

So this PR adds just one of these tools, the border image generator. If you think it makes sense, I'll add the other tools to this PR, and update mdn/content to use EmbedGHLiveSample for these pages.

@wbamberg
Copy link
Contributor Author

Oh I should have said, you can see the GH example at https://wbamberg.github.io/css-examples/tools/border-image-generator/ .

@teoli2003
Copy link
Contributor

A background on these tools: we got some young student from Eastern Europe as a Summer of Code Intern quite a few years ago to build them :-)

I think to move them is a really good idea, now that we are using git and github!

@wbamberg
Copy link
Contributor Author

Thanks @teoli2003, I think they did a really good job! Hopefully a move like this will make it easier for people to maintain them.

@rachelandrew
Copy link
Collaborator

I think this is a good location for them, so +1 from me.

@wbamberg wbamberg marked this pull request as ready for review August 11, 2021 18:21
@wbamberg
Copy link
Contributor Author

Thanks for the feedback! I got an r+ from Ruth today, so I just added the other tools to this PR, and it's ready for review.

I've made absolutely minimal changes to the pages at this point.

Built pages:
https://wbamberg.github.io/css-examples/tools/border-image-generator/
https://wbamberg.github.io/css-examples/tools/border-radius-generator/
https://wbamberg.github.io/css-examples/tools/box-shadow-generator/
https://wbamberg.github.io/css-examples/tools/color-picker/

I also made a little update to the README. I chose not to list all the tools there so we don't have to keep updating it if we ever add more.

@Rumyra Rumyra merged commit 1892a18 into mdn:master Aug 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
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.

4 participants