Giter Site home page Giter Site logo

mojocss-capsule-example's Introduction

Mojo CSS Capsule Example

An example showcasing how to create components, use options and add utilities to Mojo CSS using capsules.
This capsule will add a button component and s-[*] utilities to your project.

Usage

NPM

  1. Install the capsule package via npm:
npm install @mojocss/capsule-example
  1. Import the capsuleExample function from the installed package:
import capsuleExample from "@mojocss/capsule-example";
  1. Add the capsule to your Mojo config:
mojo({
  // Mojo CSS Config
  capsules: [capsuleExample],
});

Alternatively, you can configure specific options:

mojo({
  // Mojo CSS Config
  capsules: [
    {
      capsule: capsuleExample,
      options: {
        rounded: "full", // Border radius
        px: 6, // Padding left and right
        height: "2.5rem", //  Button Height
        text: 100, // Font size (100 = 1rem)
        textW: 400, // Font weight
      },
    },
  ],
});

CDN

<script src="https://unpkg.com/@mojocss/capsule-example"></script>

and then

mojo({
  // Mojo CSS Config
  capsules: [capsuleExample],
});

Button

This is how you use the button:

<button class="m-button"><span>My Button</span></button>

Use any color you want:

<button class="m-button bg-c-blue"><span>My Button</span></button>

Square utility

Using this utility you can control both width and height of an element.

<!-- s-6 ==> w-6 h-6 -->
<div class="s-6">...</div>

Related Resources

mojocss-capsule-example's People

Contributors

mimze avatar

Stargazers

Cătălin George Feștilă avatar  avatar Ali Mirabbasi avatar

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.