Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
scarab-carapace
Advanced tools
Highly configurable framework for generating functional CSS classes
Highly configurable framework for generating single-purpose, functional CSS classes
Carapace is a Sass framework which generates functional/atomic CSS classes based on user-defined configuration. It depends on the scarab-scss
Sass utility library for low-level functions and mixins.
Although Carapace provides some defaults, it is not an opinionated CSS library. Think of it instead as a tool for rapidly creating custom CSS libraries on a per-project basis.
scarab-styleguide
)scarab-carapace
as a dev-dependency in your project via npm:npm install scarab-carapace --save-dev
Add your node_modules
folder to your Sass includePaths
.
Import the necessary files in your main stylesheet:
// IMPORTANT
//
// Follow the import order below to ensure modules are generated properly.
@import 'scarab-scss/scarab'; // Imports scarab-scss, core utils & config
@import 'custom/config.scss'; // Your custom Scarab config
@import 'scarab-carapace/config'; // Imports default Carapace module config
@import 'custom/module-config.scss'; // Your custom Carapace module config
@import 'scarab-carapace/modules'; // Generates CSS classes
Carapace imports the scarab-scss
utility library, exposing the get()
function and set()
mixin. These utilities allow you to configure the Carapace theme and modules. Refer to the Configuration section of the README
in scarab-scss
for more information on get()
and set()
.
With the default naming convention, class names that Carapace generates will look something like this:
<section class="bgc:black c:white m(bgc:white) m(c:black) hv(c:grey) m(hv(c:dark-grey))">
<p>This section has a 'black' background with 'white' text.
When hovered, the text color changes to 'grey'.</p>
<p>On 'medium'-sized screens, it has a 'white' background with 'black' text.
When hovered, the text color changes to 'dark-grey'.</p>
</section>
The naming convention can be customized by changing the namescheme
options in Scarab.
Modules are single-purpose, functional CSS classes. Module class names and values are dynamically generated by Carapace, depending on the values set in the global $__SCARAB
variable.
Module class names consist of a root
, and optionally: variant
, modifier
, breakpoint
and state
.
In Carapace, configuration for a module typically looks like this:
@include set(modules, 'opacity', (
'root' : 'o', // String which defines the module's "root"
'group' : 'base', // Group which the module belongs to
'values' : get(opacity), // Map of "modifier" names to CSS property values
'states' : option(namescheme, states), // Map of "state" shorthands to values
'breakpoints' : get(breakpoint) // Map of "breakpoint" names to values
));
Refer to the modules/
folder for more information on how to configure modules.
Carapace does not include a build step to compile Sass to CSS. The following tasks are recommended for production:
autoprefixer
)cssnano
)sakugawa
)<link>
media query stylesDocumentation is a work-in-progress.
FAQs
Highly configurable framework for generating functional CSS classes
The npm package scarab-carapace receives a total of 12 weekly downloads. As such, scarab-carapace popularity was classified as not popular.
We found that scarab-carapace 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.