├── .browserslistrc ├── .gitattributes ├── .github ├── FUNDING.yml ├── images │ ├── cta.png │ ├── cta6.png │ └── example.png └── workflows │ ├── auto-assign.yml │ ├── cd.yml │ ├── codeql-analysis.yml │ ├── lockfile.yml │ └── markdownlint.yml ├── .gitignore ├── .mdlrc ├── .npmignore ├── .releaserc ├── .vscode ├── extensions.json └── settings.json ├── .yarnrc.yml ├── LICENSE ├── README.md ├── index.html ├── package.json ├── paint.js ├── sandbox.config.json └── yarn.lock /.browserslistrc: -------------------------------------------------------------------------------- 1 | last 2 years 2 | not < 0.05% 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | index.html linguist-vendored 2 | .yarn/ export-ignore 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: wopian 2 | ko_fi: wopian 3 | custom: 'https://paypal.me/wopian' 4 | -------------------------------------------------------------------------------- /.github/images/cta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wopian/smooth-corners/f237921e1d62c83d99c8290431ec85d2b1ffeb04/.github/images/cta.png -------------------------------------------------------------------------------- /.github/images/cta6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wopian/smooth-corners/f237921e1d62c83d99c8290431ec85d2b1ffeb04/.github/images/cta6.png -------------------------------------------------------------------------------- /.github/images/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wopian/smooth-corners/f237921e1d62c83d99c8290431ec85d2b1ffeb04/.github/images/example.png -------------------------------------------------------------------------------- /.github/workflows/auto-assign.yml: -------------------------------------------------------------------------------- 1 | name: Auto Assign 2 | on: 3 | issues: 4 | types: [opened] 5 | jobs: 6 | auto-assign: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: 'Auto Assign Issues' 10 | uses: pozil/auto-assign-issue@v1 11 | with: 12 | repo-token: ${{ secrets.GITHUB_TOKEN }} 13 | assignees: wopian 14 | -------------------------------------------------------------------------------- /.github/workflows/cd.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [develop] 6 | workflow_dispatch: 7 | branches: [develop] 8 | 9 | env: 10 | FORCE_COLOR: true 11 | NODE_VERSION: 18 12 | 13 | jobs: 14 | setup: 15 | name: Deploy Package 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - uses: actions/checkout@v4 20 | 21 | - uses: actions/setup-node@v4 22 | with: 23 | node-version: ${{ env.NODE_VERSION }} 24 | 25 | - name: Get yarn cache directory path 26 | id: yarn-cache-dir-path 27 | run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT 28 | 29 | - uses: actions/cache@v3 30 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 31 | with: 32 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 33 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 34 | restore-keys: | 35 | ${{ runner.os }}-yarn- 36 | 37 | - name: Install Dependencies 38 | run: yarn install --immutable 39 | 40 | - name: Build Package 41 | run: yarn build 42 | 43 | - name: Create Release 44 | if: success() && github.ref == 'refs/heads/develop' 45 | run: yarn semantic-release 46 | env: 47 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} 48 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 49 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ master ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ master ] 20 | schedule: 21 | - cron: '0 6 * * 1' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'javascript' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Learn more about CodeQL language support at https://git.io/codeql-language-support 38 | 39 | steps: 40 | - name: Checkout repository 41 | uses: actions/checkout@v4 42 | 43 | # Initializes the CodeQL tools for scanning. 44 | - name: Initialize CodeQL 45 | uses: github/codeql-action/init@v3 46 | with: 47 | languages: ${{ matrix.language }} 48 | # If you wish to specify custom queries, you can do so here or in a config file. 49 | # By default, queries listed here will override any specified in a config file. 50 | # Prefix the list here with "+" to use these queries and those in the config file. 51 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 52 | 53 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 54 | # If this step fails, then you should remove it and run the build manually (see below) 55 | - name: Autobuild 56 | uses: github/codeql-action/autobuild@v3 57 | 58 | # ℹ️ Command-line programs to run using the OS shell. 59 | # 📚 https://git.io/JvXDl 60 | 61 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 62 | # and modify them (or add more) to build your code if your project 63 | # uses a compiled language 64 | 65 | #- run: | 66 | # make bootstrap 67 | # make release 68 | 69 | - name: Perform CodeQL Analysis 70 | uses: github/codeql-action/analyze@v3 71 | -------------------------------------------------------------------------------- /.github/workflows/lockfile.yml: -------------------------------------------------------------------------------- 1 | name: Yarn 2 | on: 3 | pull_request: 4 | branches: 5 | - renovate/** 6 | jobs: 7 | yarn_lock_changes: 8 | name: Lock File Changes 9 | runs-on: ubuntu-latest 10 | # Permission overwrite is required for Dependabot PRs 11 | permissions: 12 | pull-requests: write 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v4 16 | - name: Digest Lock File 17 | uses: Simek/yarn-lock-changes@23b5437388098454b9d9c1574b50066b3338dbf1 18 | with: 19 | token: ${{ secrets.GITHUB_TOKEN }} 20 | collapsibleThreshold: 25 21 | failOnDowngrade: false 22 | path: yarn.lock 23 | updateComment: true 24 | -------------------------------------------------------------------------------- /.github/workflows/markdownlint.yml: -------------------------------------------------------------------------------- 1 | name: Lint Markdown 2 | on: [push, pull_request] 3 | jobs: 4 | markdownlint: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Check out code 8 | uses: actions/checkout@v4 9 | - name: Run mdl 10 | uses: actionshub/markdownlint@v3.1.4 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | 4 | .yarn/cache 5 | .yarn/unplugged 6 | .yarn/sdks 7 | .yarn/*.gz 8 | .pnp.cjs 9 | .pnp.loader.mjs 10 | -------------------------------------------------------------------------------- /.mdlrc: -------------------------------------------------------------------------------- 1 | rules '~MD002', '~MD013', '~MD033' 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .github 2 | .mdlrc 3 | .browserslistrc 4 | example.png 5 | index.html 6 | sandbox.config.json 7 | yarn.lock 8 | .yarn 9 | .vscode 10 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | branches: 2 | - develop 3 | debug: true 4 | ci: true 5 | dryRun: false 6 | plugins: 7 | - "@semantic-release/commit-analyzer" 8 | - "@semantic-release/release-notes-generator" 9 | - "@semantic-release/changelog" 10 | - "@semantic-release/github" 11 | - "@semantic-release/npm" 12 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "arcanis.vscode-zipfs", 4 | "dbaeumer.vscode-eslint", 5 | "esbenp.prettier-vscode" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules\\typescript\\lib", 3 | "search.exclude": { 4 | "**/.yarn": true, 5 | "**/.pnp.*": true 6 | }, 7 | "markiscodecoverage.searchCriteria": "coverage/lcov.info" 8 | } 9 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | cloneConcurrency: 8 2 | defaultSemverRangePrefix: '~' 3 | enableScripts: false 4 | enableTelemetry: false 5 | httpRetry: 3 6 | httpTimeout: 60000 7 | nmMode: classic 8 | nodeLinker: node-modules 9 | plugins: 10 | - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs 11 | spec: '@yarnpkg/plugin-workspace-tools' 12 | yarnPath: .yarn/releases/yarn-4.9.1.cjs 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 James Harris 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
Superellipse masks using the CSS Houdini API
17 | 18 | ![Static demo of Smooth Corners][CTA] 19 | 20 | ## Demo 21 | 22 | [Live demo](https://wopian.github.io/smooth-corners/) featuring several different `--smooth-corners` values and an interactive editor 23 | 24 | ## Limitations 25 | 26 | To avoid leaking visited sites, the CSS Paint API is disabled on Chromium-based browsers for `` elements with an `href` attribute and all children of that element. For further details see the following: 27 | 28 | - The CSS Painting API [Privacy Considerations section](https://drafts.css-houdini.org/css-paint-api/#privacy-considerations) 29 | - The CSS Painting API spec issue [“CSS Paint API leaks browsing history”](https://github.com/w3c/css-houdini-drafts/issues/791) 30 | 31 | To work around this limitation, `mask-image: paint(smooth-corners)` can be applied to the parent element of the `` element, for example: 32 | 33 | ```html 34 |