sass / sass-site

Sass Website
https://sass-lang.com
Other
319 stars 233 forks source link

[Playground] Code links #1167

Closed jamesnw closed 2 months ago

jamesnw commented 2 months ago

Adds "Edit in Playground" link to each code example in the documentation. The link will reflect the selected syntax.

If there are multiple sections in the example, for instance in the Modules section, no link is shown. Those examples require importing and a file system, which isn't supported. I'm open to other behavior here if preferred.

netlify[bot] commented 2 months ago

Deploy Preview for sass-lang ready!

Name Link
Latest commit a0ece3dbe01b5e09cdff3d18cbaf3fa9436293bf
Latest deploy log https://app.netlify.com/sites/sass-lang/deploys/66e394bbc101b7000830df0a
Deploy Preview https://deploy-preview-1167--sass-lang.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

nex3 commented 2 months ago

The functionality looks great, but I'm not sure about the styles. A few considerations that occur to me:

All that makes me think that something like this:

image

or even potentially like this:

image

would be a better fit.

As prior art here, this is what it looks like in the TypeScript documentation:

image

...where the "Try" button only shows up when the code is being hovered. I'd be fine with just copying that design as well.

stacyk commented 2 months ago

Style looks good, except it would be nice to add a bit more space between the Sass logo and "Playground".

@nex3 I made a few updates here: