Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
#3D CSS Ribbons
A extension (for Compass) to create 3D ribbons using only CSS. Live example.
The extension is inspired in 3D Ribbon Generator.
#Installation
From the command line:
sudo gem install 3d-ribbon
Installing into an existing project:
# edit the project configuration file and add:
require '3d-ribbon'
#from the command line
compass install 3d-ribbon
#import the extension into your scss/sass file
@import "3d-ribbon"
If you don't have/want use Compass, you can download the main sass file and import it:
@import "<path to the file>/_3d-ribbon.scss"
#Intro
The extension offer a simple and flexible way to create 3D ribbons with CSS.
Browser support:
You only need a block element to apply the ribbon, for example:
<h3 class="ribbon">This is my title</h3>
The simple way:
.ribbon{
@include ribbon();
}
The flexible way (with all options):
.ribbon{
@include ribbon(
// Set the background color of the ribbon
$background-color : <color>,
// Set the position of the sides
$position : <bottom> | <top>,
// Set the sides of the ribbon
$sides : <left> | <rigth> | <left right>,
// Set the width of the overlaps
$overlap-horizontal : <width>,
// Set the height of the overlaps
$overlap-vertical : <height>,
// Set the color of the edges
$overlap-color : <color>
)
}
#Settings:
Set the background color of the ribbon. Default value: #428bca
.
Set the position of the sides. Default value: top
.
Set the sides of the ribbon. Default value: left right
.
Set the width of the overlaps. Default value: 30px
.
Set the height of the overlaps. Default value: 20px
.
Set the color of the edges. Default value: darken(#428bca, 30%)
.
#Adding the ribbon's back
If you want the ribbon's back you need add some spans into your HTML:
<h3 class="ribbon">
This is my title
<span class="ribbon-left"></span>
<span class="ribbon-right"></span>
</h3>
Later in your sass use the ribbon-back
mixin:
.ribbon-left{
@include ribbon-back($side: left);
}
.ribbon-right{
@include ribbon-back($side: right);
}
The mixin also have many setting for customization:
.ribbon-back{
@include ribbon-back(
// The side to create. This is the only required param
$side,
// Set the background color of the ribbon's back
$background-color : <color>,
// Set the position of the ribbon's back
$position : <top> | <bottom>,
// Set the height of the ribbon's back
$height : <height>,
// Set the width of the ribbon's back
$width : <width>,
// Set the vertical distance of the ribbon's back
$horizontal-distance : <height>,
// Set the horizontal distance of the ribbon's back
$vertical-distance : <width>,
// Set the color of the back's snip
$snip-color : <color>
)
}
It's probably that the two mixins (ribbon
and ribbon-back
) share values, so, the best way is declare some variables to use with the mixins. For example:
$ribbon-background-color: #d9534f;
$ribbon-position: top;
$ribbon-sides: left right;
$ribbon-overlap-horizontal-distance: 20px;
$ribbon-overlap-vertical-distance: 15px;
$ribbon-back-width: 20px;
$ribbon-back-height: 30px;
.ribbon{
@include ribbon(
$background-color: $ribbon-background-color,
$position: $ribbon-position,
$sides: $ribbon-sides,
$overlap-horizontal: $ribbon-overlap-horizontal-distance,
$overlap-vertical: $ribbon-overlap-vertical-distance,
$overlap-color: darken($ribbon-background-color, 30%)
);
@each $side in $ribbon-sides {
.ribbon-#{$side}{
@include ribbon-back(
$side: #{$side},
$background-color: $ribbon-background-color,
$position: $ribbon-position,
$width: $ribbon-back-width,
$height: $ribbon-back-height,
$horizontal-distance: $ribbon-overlap-horizontal-distance,
$vertical-distance: $ribbon-overlap-vertical-distance,
$snip-color: transparent
);
}
}
}
FAQs
Unknown package
We found that 3d-ribbon 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.