
Security News
Node.js Moves Toward Stable TypeScript Support with Amaro 1.0
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
@madgex/design-system
Advanced tools
A work-in progress Design System for building a UI for Madgex products.
A work-in progress Design System for building a UI for Madgex products.
Available on NPM as @madgex/design-system.
npm install @madgex/design-system --save
NOTE: Right now you'll need to be authenticated on npm under the Madgex account.
You'll need to use the Madgex DS CSS file in your project (which you will find in @madgex/design-system/dist/css/index.css
)
The design system is using CSS Custom Properties to apply the brand styling of each site so you will need to import the custom properties file found in S3 for each client property id as well.
if you want to use the default styling set in the design system, you can use the variables.css
file found in dist/_tokens/css
.
If you're wanting to use the Madgex DS components from a hapi.js+vision+Nunjucks setup you'll need to include the Madgex DS in the Nunjucks pathing:
engines: {
njk: {
compile: (src, options) => {
const template = Nunjucks.compile(src, options.environment);
return (context) => {
return template.render(context);
};
},
prepare: (options, next) => {
options.compileOptions.environment = Nunjucks.configure(
[
Path.join(options.path),
'node_modules/@madgex/design-system/',
'node_modules/@madgex/design-system/src/',
'node_modules/@madgex/design-system/src/components/',
],
{ watch: false }
);
return next();
},
},
},
Then you should be able to use components as such:
{% extends "template.njk" %} {# a base template is available in the DS #}
{% from "button/_macro.njk" import Button %} {# load the DS button component #}
{% block content %}
<p>My new project homepage</p>
{# Use the Madgex DS button! #}
{{
Button({
text: 'Click me please!'
})
}}
{% endblock %}
Note you'll need the CSS for the component styles.
With every commit to master
the build server attempts to create a new version using semantic-release and deploys to npm as @madgex/design-system.
You can see your changes to the jobseekers-frontend in a local dev enviroment by using npm link.
cd [your local path]/madgex-design-system
npm link
cd [your local path]/jobseekers-frontend
npm link npm link @madgex/design-system
We use Style Dictionary to build our Design System tokens.
createStyleDictionary(StyleDictionaryConfig)
is exposed via @madgex/design-system/style-dictionary
.
This creates a new StyleDictionary Instance, preconfigured with our base tokens, and all platforms we want to build. See here for the base config we use.
You can supply overrides to createStyleDictionary
which should be the same shape as Style Dictionary Configuration.
Typically you will only override buildPath
on platforms (so the platform builds with the same transforms everywhere), and supply source
token override file paths.
A platform
determines a certain type of output based on the tokens.
When you create a new StyleDictionary Instance via createStyleDictionary
, it comes with our pre-configured platforms :
variables.css
to buildPath
, CSS Variablesvariables.json
to buildPath
, JSON version of CSS Variables, useful for rendering in Node e.g. display-image-render-api or template-renderervariables-flat.json
to buildPath
. similar to 'json-variables' but in a flat object structureIn this example we override the buildPath
of our pre-configured platforms
.
We also supply paths to override token files via source
.
We then build only the platforms we want, and then call cleanTempFiles once we're done.
const path = require('node:path');
const { createStyleDictionary, cleanTempFiles } = require('@madgex/design-system/style-dictionary');
const { styleDictionary, cleanTempFiles } = await createStyleDictionary({
platforms: {
'css-variables': {
buildPath: `${path.resolve(__dirname, '../yes-here')}/`,
},
'json-variables': {
buildPath: `${path.resolve(__dirname, '../yes-here')}/`,
},
},
source: [path.resolve(__dirname, '../brand.json')],
});
await styleDictionary.buildPlatform('css-variables');
await styleDictionary.buildPlatform('json-variables');
await cleanTempFiles();
FAQs
A work-in progress Design System for building a UI for Madgex products.
The npm package @madgex/design-system receives a total of 122 weekly downloads. As such, @madgex/design-system popularity was classified as not popular.
We found that @madgex/design-system demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 20 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
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.