![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
styled-shapes
Advanced tools
Styled-System compatible shapes for use in your JSX
Checkout Storybook for some examples / demos.
npm i styled-shapes
import { Shape, star, hexagon } from 'styled-shapes';
const Star = () => <Shape path={star}/>;
const CustomShape = () => <Shape path="M 0,0 1,0, 1,1, 0,1 Z"/>;
const ShapeWithBordersAndShadow = () => <Shape path={hexagon} border="1px solid black" boxShadow="0 0 .5em rgba(0,0,0,.5)"/>;
<Shape color="blue" background="red" path={star}/>
<Shape fontSize="10px" path={hexagon}/>
<Shape background="linear-gradient(#000, #fff)" path={triangle}/>
<Shape borderTop="1px solid blue" borderBottom="2px solid green" path={moon}/>
<Shape boxShadow="0 0 3px rgba(0,0,0,.6), inset 0 0 3px rgba(255,255,255,.5)" path={pentagon}/>
polygon(n: number)
<Shape path="M 0,0 1,0 1,1 0,1 Z"/>
"Standard" HTML elements are limited to the box model, i.e. rectangles. We can get additional shapes by manipulating borders, border radiuses, and/or css transforms to skew rectangles into other shapes. But, these shapes still have some limitations:
For example: using "plain" HTML and CSS, its hard to make a 5 pointed star with both borders and box shadows.
Meanwhile, SVGs lets us build arbitrary shapes in our webpages. But, SVGs do not support the same css properties as non-SVG components.
stroke
instead.Canvas/WebGL let us draw almost anything we can imagine. But, by drawing raw images to the screen, we are no longer building the page semantically.
This library attempts to bridge the differences between SVG and HTML - allowing users to build arbitrary shapes while still using semantic HTML and the CSS properties we're used to. (via styled system).
Implementation:
<svg/>
filters + dropshadow<svg/>
paths with stroke, broken apart at via trigonometry > 45 (top), > 135 (left) , > 225 (bottom), > 315 (right) degreespath
For more about CSS in JS, checkout the styled-system or this article.
MIT
FAQs
html shapes implemented with styled-system props
The npm package styled-shapes receives a total of 1 weekly downloads. As such, styled-shapes popularity was classified as not popular.
We found that styled-shapes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.