Madgex Design System
A work-in progress Design System for building a UI for Madgex products.
Usage
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.
Importing styles
You'll need to import the Madgex DS styles into your project scss file.
Use the DS tokens to change DS variables.
e.g. import the Madgex DS to your Sass file & overload variables:
$mds-color-brand-colour-1: #ff0000;
$mds-size-font-md: 20px;
@import 'node_modules/@madgex/design-system/src/scss/index.scss';
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 scss for the component styles.
Working with vue.js
Install the design system package. Then import components as you require like so:
<template>
<MdsPagination />
</template>
<script setup>
import { MdsPagination } from '@madgex/design-system/vue/index.js';
</script>
Releases
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.
Local Development with jobseekers-frontend
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