Giter Site home page Giter Site logo

divriots / simba Goto Github PK

View Code? Open in Web Editor NEW
21.0 5.0 2.0 669 KB

Lion-based Design System

Home Page: https://backlight.dev/review/5vtJtbY04aoD1dGKcsu1

License: MIT License

JavaScript 94.95% HTML 0.22% CSS 4.83%
backlight tailwindcss lion design-system webcomponents

simba's Introduction

Simba

For the old NPM package, see starter-simba.

Brought to you by
‹div›RIOTS ‹div›RIOTS

A lion based design system as a starter kit for Backlight, an all-in-one Design System platform, design inspired by TailwindCSS.

Click the "Edit" button to also see the source code in the Backlight editor.

Features

  • 🍴 Easy to fork and create your own variation using Backlight
  • ⚒️ Interoperable, built on top of platform-standards, works in any framework
  • 🌙 Darkmode out of the box
  • 🦄 Theming capabilities, choose any color from Tailwind palette out of the box, with room for more!
  • 📦 Available on NPM to extend or use directly

In case you don't use Backlight.dev but use straight from NPM, refer to our usage from NPM guide.

Migration

Migrating to a new minor (since this is alpha), see Migration Docs.

Usage

Duplicate in Backlight

This is the recommended way, as backlight gives you an all-in-one Design System platform.

In order to create your own project from this starter kit using Backlight, go to the Backlight website and sign up, request early access, or log in if you already have an account.

Make sure you have a Backlight Workspace, then go to simba-starter on backlight and click the Duplicate button in the top right corner, this will create a project based on this starter-kit for you.

import { html } from '~/core';
import '~/button/define';

export const templ = html`<simba-button>Submit</simba-button>`;

Contributing

See our Contribution Guidelines

Rationales

Types

Lion comes with type definition files and can be used in TypeScript. At the moment, simba-starter does not come with types out of the box just yet, but as this starter-kit progresses, we may add them, either by converting the project to Typescript or by using JSDocs similar to Lion's setup.

Tests

Lion comes with thousands of tests already, so 95% of the functionality that simba relies on is quite thoroughly unit-tested already. That said, simba adds opinionated extensions on top of lion that are not tested as of now. This will likely be added later and contributions are of course welcome.

Docs

For documentation, we opt for MDJS, Markdown Javascript. This is markdown files with custom codeblock syntaxes to allow for interactive demos, right in the middle of your written documentation. We believe this is a good way to showcase components, as it is both narrative and live-demo-based. If you use Backlight, MDJS integration comes out of the box, so you can go ahead and start writing your MDJS-markdown files straight away without any setup!

Structure

In the studio.config.json we define the structure of this starter-kit, which basically consists of four sections:

  • Tokens, values such as colors and spacings, needed to construct and maintain the design system and components
  • Components, lion-based UI components
  • Infrastructure, utilities and mixins used across multiple components.
  • Docs, any utilities used to style the documentation in Backlight or add functionality.

Importing lion modules

At this moment, simba does not re-export everything from @lion just yet. Everything from @lion/core is re-exported, meaning that you can import things like html, LitElement, etc. from @divriots/simba-starter/core or ~/core locally. This is recommended, because it avoids deduplication issues.

If you need to import from @lion directly, it's important that installations of lion and its dependencies are properly deduped. In Backlight, this is taken care of for you on the backend, and you won't have to worry about it. If you use simba outside of Backlight, you will need to ensure that deduplication is handled, otherwise you will run into breaking bugs.

!important in ::slotted selectors

Right now, as per W3C specs, ::slotted CSS specificity is just that of a pseudo element. Unlike :host, it does not include the specificity of the passed argument selector.

This means that almost any selector from outside that targets the slotted element will override your ::slotted CSS. This is not ideal, there's an open issue to try to improve this.

For now the workaround is to use !important for all your CSS rules inside ::slotted to protect them from being overriden by the outside. Sadly, this means you will have to fight cascade battles and use !important yourself too, which is probably worse than fighting specificity battles, but so be it until the spec changes.

simba's People

Contributors

bashmish avatar georges-gomes avatar gluck avatar jorenbroekema avatar thais-divriots avatar

Stargazers

 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

simba's Issues

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.