
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
attainia-web-components
Advanced tools
A collection of Attainia branded web components to be used in an Attainia React.js web application.
scss
See docs to get started with Carbon SCSS.
While we do not recommend using Carbon along with another design system in one application because doing so loses coheisiveness in your application's user experience, you can use "selector namspacing" technique e.g. while you are migrating from another design system to Carbon and just flipping the switch at once is extremely hard.
Below example generates CSS files whose CSS selectors are namespaced, e.g. textarea
selector converted to .carbon textarea
:
const gulp = require('gulp');
const postcss = require('gulp-postcss');
const prefixSelector = require('postcss-prefix-selector');
gulp.task('postcss:carbon', () =>
gulp.src('node_modules/carbon-components/css/carbon-components.css')
.pipe(postcss([prefixSelector({
prefix: '.carbon',
transform: (prefix, selector, prefixedSelector) => {
const list = [prefixedSelector, selector + prefix];
if (selector === 'html' || selector === 'body') {
// Mimics styles to `<html>`/`<body>` with e.g. `.carbon--body`
list.push(`${prefix}--${selector}`);
}
return list;
},
})]))
.pipe(gulp.dest('dist')));
gulp.task('postcss:another-design-system', () =>
gulp.src('node_modules/another-design-system/path/to/another-design-system.css')
.pipe(postcss([prefixSelector({
prefix: '.another-design-system',
transform: (prefix, selector, prefixedSelector) => {
const list = [prefixedSelector, selector + prefix];
if (selector === 'html' || selector === 'body') {
// Mimics styles to `<html>`/`<body>` with e.g. `.another-design-system--body`
list.push(`${prefix}--${selector}`);
}
return list;
},
})]))
.pipe(gulp.dest('dist')));
gulp.task('postcss', ['postcss:carbon', 'postcss:another-design-system']);
Below HTML is an example using a Carbon button is used along with a button with another design system, using what above build step generaes:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="./dist/carbon-components.css">
<link rel="stylesheet" type="text/css" href="./dist/another-design-system.css">
</head>
<body>
<div class="bx--body carbon--body carbon--html">
<button class="carbon bx--btn bx--btn--primary">Carbon</button>
</div>
<div class="another-design-system--body another-design-system--html">
<button class="another-design-system btn btn-primary">Another design system</button>
</div>
</body>
</html>
FAQs
A collection of Attainia branded web components to be used in an Attainia React.js web application.
The npm package attainia-web-components receives a total of 58 weekly downloads. As such, attainia-web-components popularity was classified as not popular.
We found that attainia-web-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.