Gathering detailed insights and metrics for @madgex/design-system
Gathering detailed insights and metrics for @madgex/design-system
Gathering detailed insights and metrics for @madgex/design-system
Gathering detailed insights and metrics for @madgex/design-system
npm install @madgex/design-system
Typescript
Module System
Min. Node Version
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
48
A work-in progress Design System for building a UI for Madgex products.
Available on NPM as @madgex/design-system.
1npm 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:
1 engines: { 2 njk: { 3 compile: (src, options) => { 4 const template = Nunjucks.compile(src, options.environment); 5 return (context) => { 6 return template.render(context); 7 }; 8 }, 9 prepare: (options, next) => { 10 options.compileOptions.environment = Nunjucks.configure( 11 [ 12 Path.join(options.path), 13 'node_modules/@madgex/design-system/', 14 'node_modules/@madgex/design-system/src/', 15 'node_modules/@madgex/design-system/src/components/', 16 ], 17 { watch: false } 18 ); 19 return next(); 20 }, 21 }, 22 },
Then you should be able to use components as such:
1{% extends "template.njk" %} {# a base template is available in the DS #} 2 3{% from "button/_macro.njk" import Button %} {# load the DS button component #} 4 5{% block content %} 6 7 <p>My new project homepage</p> 8 9 {# Use the Madgex DS button! #} 10 {{ 11 Button({ 12 text: 'Click me please!' 13 }) 14 }} 15 16{% 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.
1cd [your local path]/madgex-design-system 2npm link 3cd [your local path]/jobseekers-frontend 4npm 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.
1const path = require('node:path'); 2const { createStyleDictionary, cleanTempFiles } = require('@madgex/design-system/style-dictionary'); 3 4const { styleDictionary, cleanTempFiles } = await createStyleDictionary({ 5 platforms: { 6 'css-variables': { 7 buildPath: `${path.resolve(__dirname, '../yes-here')}/`, 8 }, 9 'json-variables': { 10 buildPath: `${path.resolve(__dirname, '../yes-here')}/`, 11 }, 12 }, 13 source: [path.resolve(__dirname, '../brand.json')], 14}); 15 16await styleDictionary.buildPlatform('css-variables'); 17await styleDictionary.buildPlatform('json-variables'); 18 19await cleanTempFiles();
No vulnerabilities found.
No security vulnerabilities found.