GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - PoshWeb/Shape: CSS Shapes with PowerShell

BranchesTags
Open more actions menu

Latest commit

 

History

37 Commits
37 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
Build
Build
 
 
Commands
Commands
 
 
Types/Shape
Types/Shape
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
README.md.ps1
README.md.ps1
 
 
Shape.psd1
Shape.psd1
 
 
Shape.psm1
Shape.psm1
 
 
Shape.tests.ps1
Shape.tests.ps1
 
 
Shape.types.ps1xml
Shape.types.ps1xml
 
 
action.yml
action.yml
 
 
code_of_conduct.md
code_of_conduct.md
 
 
contributing.md
contributing.md
 
 
security.md
security.md
 
 

Repository files navigation

Shape

CSS Shapes with PowerShell

CSS Shapes are pretty amazing!

There are 8 shape types:

  • circle
  • ellipse
  • inset
  • path
  • polygon
  • rect
  • shape
  • xywh Unfortunately, that also means there are 8 slightly different ways to write a shape.

Polygons work in pairs. Paths must be quoted.

Most others need to be joined with spaces, but shape itself needs to be joined with spaces and commas before keywords.

This module exists in order to make it slightly easier to generate shapes.

Installing and Importing

You can install the module from the PowerShell Gallery:

Install-Module Shape

After it is installed, you can simply import it:

Import-Module Shape -PassThru

Cloning and importing

You can also clone this repository and import the module locally:

git clone https://github.com/PowerShellWeb/Shape
cd ./Shape
Import-Module ./ -PassThru

Getting Started

Shape tries to have simple syntax.

After importing, we can create any CSS shape with simple syntax

circle 50% 
ellipse 4rem 50% at right center

Using Shapes

To use a shape in a page, we simply make it into a string.

".circle { width: 100%; height: 100%; clip-path:$(circle 50%) }"

Here's a page with nothing but an ellipse.

We need to provide a background color to see the shape.

@(
    "<html>"
    "<head><style>"    
    "body { max-width: 100vw; height: 100vh}"
    ".ellipse { background-color: #4488ff;width: 100%; height:100%; clip-path:$(ellipse 50% 50%); }"
    "</style></head>"
    "<body><div class='ellipse'></div></body>"
    "</html>"
) > ./ellipse.html

Here's a page with nothing but an inset path:

@(
    "<html>"
    "<head><style>"    
    "body { max-width: 100vw; height: 100vh}"
    ".inset { background-color: #4488ff;width: 100%; height:100%; clip-path:$(inset 5%); }"
    "</style></head>"
    "<body><div class='inset'></div></body>"
    "</html>"
) > ./inset.html

You can use the shape module to generate any CSS shape.

Have Fun!

About

CSS Shapes with PowerShell

Topics

cssgithub-pageshtmlpowershellpowershell-modulestatic-site-generatorwebweb-standards

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.