Giter VIP home page Giter VIP logo

m-'s Introduction

Mdash logo

A design system that fully embraces web standards.

Mdash seeks to leverage HTML, not replace it or try to outsmart it.
This makes Mdash ideal for all web projects and skill levels.

linkable | tiny 6kb | responsive | accessible | zero dependencies


Mdash UI elements are built with 100% web standards following the TAC CSS methodology. This makes Mdash extremely light, very fast, and compatible with any type of web project.

Mdash can work with any framework client-side and server-side or no framework at all because it's made from native HTML, custom HTML tags, and Custom Elements. Be it SSR, SPA, PWA, static site, and even some email templates - whatever type of project you have Mdash will work. This is especially useful to organizations looking to share a design system across products.

Try Mdash right now by simply linking to the CDN files below and visiting the doc site for code samples and full API documentation.

To apply your own design language, fork and customize Mdash. It's 100% vanilla HTML, CSS, and JavaScript.

Quick start

This is the web. Include these files in <head> and you're all set!

<link href="https://unpkg.com/[email protected]/dist/m-.woff2" rel="preload" as="font" crossorigin>
<link href="https://unpkg.com/[email protected]/dist/m-.css" rel="stylesheet">
<script src="https://unpkg.com/[email protected]/dist/m-.js" defer></script>

Or install via NPM and bundle with your own assets: npm install m- (built files are located in /dist)

Then try some Mdash:

<m-alert type="success">Success!</m-alert>

Browser support

Mdash works with the latest versions of all mainstream browsers.

Working on this project

Pre-reqs: Node and Gulp CLI

  1. Clone the repo (or fork)
  2. cd m-
  3. npm install
  4. gulp watch
  5. cd docs
  6. npm install
  7. npm start

That builds Mdash, watches for changes, and starts the doc site. Start coding!

Developer notes

Custom Element constructors have strict rules about what you can safely do inside them. Please get familiar with Requirements for custom element constructors and reactions.

Some components are custom HTML tags that require no JavaScript. Other components are Custom Elements and for these the styles are still maintained in a separate CSS file.

The TAC CSS methodology is followed.

Some IDEs complain about unknown HTML tags. If that's the case, add this list to make it happy:

m-accordion, m-alert, m-autocomplete, m-badge, m-box, m-breadcrumb, m-col, m-container, m-crumb, m-dot, m-icon, m-loader, m-menu, m-row, m-tab, m-tabs, m-tag, m-vbar

m-'s People

Contributors

alexislefebvre avatar dependabot[bot] avatar jfbrennan avatar mppfiles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m-'s Issues

Focus indicator on summary details page (accordion)

https://m-docs.org/accordion

The accordion (summary and details) example on the page does not have visible focus indicators.

They are being overridden in the theme with

button:active, button:focus, details>summary:focus {
    outline: 0;
}

Additionally (sorry to mix reports) there is an error in the JS on the page.

Uncaught SyntaxError: Invalid or unexpected token. File: accordion: 171

<code-sample readonly="readonly">
  // Imperative
  <script>
    const handleToggle = e => \{ <---- this is leaking into the DOM

Chrome latest stable 92.0.4515.131

I understand that the example does not auto close other items and is just wrapped summary and details elements, so I don't think it has any impact of the page functionality but I thought I would let you know!

Adding charts/graphs

It would be useful to have components for simple (static is fine) pie, doughnut, line, and bar charts/graphs. This is a fantastic library and concept and with charts/graphs, it would have everything I need to build web interfaces.

Memory leaks using addEventListeners

The m-autocomplete, m-menu, and m-dialog components are creating event listeners during connectedCallback phase, but not releasing on disconnectedCallback. This keeps the actual instance of the element in the memory even after it's no longer exists in the DOM.

Scroll for Tabs

Add an option for horizontal scrollable Tabs. This could be the addition of a scroll-x helper class or maybe a scroll boolean attribute unique to Tabs.

Also, this is the rare case where the scrollbar should be removed, which is done like this:

/* Hide scrollbar for Chrome, Safari and Opera */
.example::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.example {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

Some info

Hello,
I am trying to use this library for my project, I have 2 issues:

  1. I cannot find in the docs the description of "bg-white" class, I understand it defines background color, but when I apply for example it to a span element it does not work; is there a way to do something like this:

<span class="bg-red">1</span>

  1. Is there a way to have a bigger "badge" (and maybe a square one?); doing something like this will cut the text:

<m-badge count="2" class="txt-lg">

while doing this will make it a rounded rectangle instead of a circle:

<m-badge count="2" class="txt-lg mar-all-sm">

Thank you!
Camillo

Question: How should I override the values of the tokens inside custom-props.css ?

This seems like a really cool lite weight library and I love how its framework agnostic and seems like a good option for building a design system on top of. I'm wondering if there is a recommended way to change the value of some of the tokens so I can try to "theme" m-dash to my liking?

I'm new to css variables so if there's an obvious solution it eludes me. I thought that perhaps you could just create your own css file in your project and assign new values to the tokens you defined, but again not sure if that's the way to go. Any thoughts?

Icons doc page is broken

The icons showcase is not working. The page shows this error:

Uncaught DOMException: CSSStyleSheet.cssRules getter: Not allowed to access cross-origin stylesheet

Docs website issues for colourblind users

For colourblind people (especially those with Protanopia), the current Ace editor theme (ace-monokai) used in the Documentation has #F92672 on black which suffers from a low contrast ratio and is very difficult to read (even when highlighting).

I'd suggest something like solarized dark or merbivore, or if you want to get customised, ayu-theme: https://github.com/ayu-theme/ayu-ace

Obviously this is just my opinion, so you're free to discard at will, however I will say that's it's currently quite difficult to read the demo code. :)

Tailwind Comparision

Could you please provide in the docs of the size of tailwind? I would love to see the comparison.
Here:
image

Docs Suggestions

Editorial opinion, worth exactly what you paid for it:

I appreciate and agree with a lot of what you have to say about modern web development (especially the J2EE comparison) but I wonder if some people might find it alienating. I used to be more aggressive with my messaging around htmx/intercooler.js, but I dialed it back over time and have had more success, fwiw.

For the docs site, I'm not sure how you are hosting it, but I am using netlify for htmx and it has worked really well. I am using the eleventy static site building system, which is OK, but is supported by netlify OOTB (including layouts, etc.) You get https almost for free, which is also nice.

Finally, my first impression of m- is concern about the custom tags. I know that custom tags are a thing, but I just don't have a lot of experience with them. I see them briefly mentioned (https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements) but for someone like me, a bit more information on them would help me get comfortable with them.

Good luck w/ the project!

Broken link to "TAC Methodology"?

On the home page, there's a section heading called "Where did Mdash come from" that says in part:

It was during this time the TAC methodology was created with Mdash being the first open-source implementation.

The phrase "TAC methodology" is linked with an anchor tag but there is no HREF. Should this be pointing to something?

Button focus styles

Hi! I really love the project! I feel it's the closest I have seen to a UI system I would like.

I found one obvious accessibility issue with buttons. When navigating with tab on the keyboard, there is not way of knowing if a button is focused or not because the outline seems to be completely removed.

Could we add some focus styles to buttons?

Dynamic positioning for Menu

Menus need to be viewport aware and reposition as they go out of view (scrolling, left edge, right edge).

Going to add support for repositioning if bottom or right edge exceed viewport (not applicable on top and left edges)

Question: M-Alert

M-Alert takes all children, creates a div and places everything inside.
Seems like a proper usage of <slot> could solve it.

It also breaks interoperability with other libraries by mutating the DOM. Example:

Lib X has a component that uses m-alert.
Render phase complete, then m-alert alters the DOM.
Lib X Might break.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.