Skip to content

css(fix): update 'shape()' page#39454

Merged
estelle merged 4 commits intomdn:mainfrom
OnkarRuikar:css_shape_fn
May 13, 2025
Merged

css(fix): update 'shape()' page#39454
estelle merged 4 commits intomdn:mainfrom
OnkarRuikar:css_shape_fn

Conversation

@OnkarRuikar
Copy link
Copy Markdown
Contributor

The PR updates via -> with and 160px 1px 20% 16px -> 160px 1px / 20% 16px. The examples have also been updated.

Test this on Chrome or Safari. Firefox hasn't released the feature yet.

@OnkarRuikar OnkarRuikar requested a review from a team as a code owner May 8, 2025 09:45
@OnkarRuikar OnkarRuikar requested review from chrisdavidmills and removed request for a team May 8, 2025 09:45
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/s [PR only] 6-50 LoC changed labels May 8, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 8, 2025

Preview URLs

(comment last updated: 2025-05-10 02:28:57)

Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

Thanks @OnkarRuikar, this is looking pretty good!

My only comment is that, in .shape2 in the second example, the first shape looks a bit messy. It should surely be symmetrical?

@estelle
Copy link
Copy Markdown
Member

estelle commented May 8, 2025

the example is giving me text ("Your browser doesn't support the shape() function yet.")
instead of the shape in edge and chrome, which are both listed as supportive.

@OnkarRuikar
Copy link
Copy Markdown
Contributor Author

OnkarRuikar commented May 8, 2025

My only comment is that, in .shape2 in the second example, the first shape looks a bit messy. It should surely be symmetrical?

@chrisdavidmills I tried to make it a heart. Now I've made it symmetrical.

instead of the shape in edge and chrome, which are both listed as supportive.

@estelle try nightly or dev builds of Chrome. Or try Safari on ipad.

Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

@OnkarRuikar Cool, the heart looks good.

I'm seeing support for the second demo in Chrome 136, Edge 136, but not Firefox Nightly.

I'm seeing support for the first demo in Chrome Canary 138 only (Chrome/Edge 136 give me the not supported message, and Firefox kind of supports it but it doesn't work properly)

So I think the content update is fine, but the BCD needs some followup work.

@OnkarRuikar
Copy link
Copy Markdown
Contributor Author

@chrisdavidmills it's a bit complicated. There are two things to consider:
a. The support for the original shape() with via keyword. The BCD is correct.
b. The shape() function got its syntax changed via -> with. Only Safari has made prod release of this change. Others are still catching up.

@chrisdavidmills
Copy link
Copy Markdown
Contributor

@chrisdavidmills it's a bit complicated. There are two things to consider: a. The support for the original shape() with via keyword. The BCD is correct. b. The shape() function got its syntax changed via -> with. Only Safari has made prod release of this change. Others are still catching up.

You are right, but the trouble is that the via -> with change and the updated demos make the BCD appear incorrect for Chromium browsers. Would it be worth adding a note to clarify? It is such a minor change that it doesn't warrant a subfeature or alternative name.

@chrisdavidmills
Copy link
Copy Markdown
Contributor

I don't think this blocks the merge, BTW. I'm happy to merge as-is.

@OnkarRuikar
Copy link
Copy Markdown
Contributor Author

Would it be worth adding a note to clarify?

Yes, let's add the note in BCD. Raised an issue there: mdn/browser-compat-data#26756

@estelle
Copy link
Copy Markdown
Member

estelle commented May 9, 2025

instead of the shape in edge and chrome, which are both listed as supportive.

@estelle try nightly or dev builds of Chrome. Or try Safari on ipad.

Shape() is supported for clip-path but not offset path in Edge. We should likely updated the generated content to say that.

@estelle
Copy link
Copy Markdown
Member

estelle commented May 9, 2025

I was working on a heart:

 clip-path: shape(
    from 20px 70px, 
    arc to 100px 70px of 1% cw,
    arc to 180px 70px of 1% cw,
    curve to 100px 190px with 180px 130px,
    curve to 20px 70px with 20px 130px);

in case you want to use it. (https://codepen.io/estelle/pen/PwwdrbR)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@estelle estelle merged commit ce8b5d6 into mdn:main May 13, 2025
8 checks passed
@OnkarRuikar OnkarRuikar deleted the css_shape_fn branch May 13, 2025 02:53
wbamberg added a commit to wbamberg/content that referenced this pull request May 21, 2025
* upstream/main: (40 commits)
  Add a guide on xs-leaks (mdn#38977)
  chore: Link to child pages in SVG, URI section (mdn#39470)
  Correct page title for `Uint8Array.prototype.setFromHex()` (mdn#39494)
  Bump markdownlint-cli2 from 0.17.2 to 0.18.0 (mdn#39488)
  Add more documentation for sizes=auto (mdn#39464)
  css(fix): update 'shape()' page (mdn#39454)
  Expand Compression Dictionary format description (mdn#39441)
  Add username/password section to URLs guide (mdn#39487)
  Fix typos (mdn#39481)
  CSS: mask-position property description (mdn#39449)
  Adding @starting-style to CSS nesting at-rules (mdn#39473)
  feat(aria): Add short titles, format titles for roles (mdn#39472)
  Fix Circle Collision detection algorithm (mdn#39484)
  Add warning against using element IDs as global properties. (mdn#39422)
  Fix typos in web audio spatialization basics (mdn#39476)
  More Error Messages (mdn#39419)
  Add links to CSS sidebar (mdn#39445)
  css: add 'stretch' value examples (mdn#39451)
  chore: link to unlinked child pages (mdn#39469)
  Fix typos (mdn#39465)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shape() Syntax Outdated

4 participants