A micro (3kb) CSS framework

  • By Jenil Gogari
  • Last update: Jan 8, 2023
  • Comments: 16



A really small CSS framework

npm bundle size Mentioned in Awesome CSS Frameworks


  • ⚡️   Super light-weight. Just ~3kb (minified + gzipped).
  • ⛔️   No preprocessor, just plug-n-play
  • 📐   Magical 12 column grid
  • 🌈   Easy to extend with CSS variables
  • 🎲   Comes with a handful of components & utilities
  •   Good Semantics
  • 🤡   Supports icons from Icongram

Get started

CDN:

<link rel="stylesheet" href="https://unpkg.com/chota">

npm or yarn:

npm install chota

SASS support

Chota is designed keeping in mind ease-of-use and minimalism, hence it doesn't use any preprocessor or complex build process. If you would still like to extend it further using SASS, head to palmiak's fork.


Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
iOS Safari
iOS Safari
Chrome for Android
Chrome for Android
Edge 16+ last 2 versions last 2 versions last 2 versions last 2 versions last 2 versions last 2 versions

Contributing

Welcome! Please see our contributing guidelines.

License

© Jenil Gogari 2017-present. Code released under the MIT license.

Github

https://github.com/jenil/chota

Comments(16)

  • 1

    Do you know what `chota` means in spanish?

    Hey! I don't intend to be a troll here, just informative. Maybe you already know, but in the "Rio de la Plata" at least (basically, Uruguay and Argentina), chota is a quite popular slung for referring to the male sexual organ. I'm pretty sure that all the other spanish speaking countries will understand the same for that word. That's actually quite funny (specially because is "really small" haha), but also something you should consider in case you want to make your lib mainstream. Bests!

  • 2

    Add .row-reverse to reverse direction

    Added a row-reverse class that allows reversing the direction of rows & hence the stack order.

    Right now the following layout is impossible:

    Desktop 
    
    +-------+-------+
    | Text  | Image |
    +-------+-------+
    | Image | Text  |
    +-------+-------+
    
    Mobile
    
    +-------+
    | Text  |
    +-------+
    | Image |
    +-------+
    | Text  |
    +-------+
    | Image |
    +-------+
    
    

    Adding a .row-reverse class allows you to flip the direction of columns on desktops, whilst still stacking up correctly (text above image) on mobile.

    An example that implements the above layout:

    <div class="row row-reverse">
      <div class="col-6">
        <div>Image</div>
      </div>
      <div class="col-6">
        <div>Text</div>
      </div>
    </div>
    
    <div class="row">
      <div class="col-6">
        <div>Image</div>
      </div>
      <div class="col-6">
        <div>Text</div>
      </div>
    </div>
    

    Note: The docs include chota.css from unpkgd instead of the project dist/ so the docs don't reflect the new built I've made that includes this change.

  • 3

    Button element 'font-family' diverges from a[role=button] or a[class=button] on Chrome

    There's a bug when switching from a <a> element to a <button> element caused by the button element not having font-family defined (defaults to Arial in my browser).

    Browser: Google Chrome v76.0.3809.100 OS: Windows 10 OS Version 1803

    To reproduce you just have to compare css of an element of type:

    <a class="button primary">Submit</a>
    

    With the same as a button:

    <button class="button primary" type="submit">Register</button>
    

    The

  • 4

    Dropdown menus / button list

    This project could benefit from a dropdown component like this I think: https://codepen.io/connorbrassington/pen/raNrEW (not mine, just a random example I found).

  • 5

    Grid Layout Overflow Problem

    The Grid Layout should be usable without a container (e.g. .container) / defined parent width as well. Otherwise the row is wider than 100% of the body and creates a horizontal scrollbar. I would recommend adding .row { max-width:100%; } then this Problem doesn't appear anymore.

  • 6

    Selected option does not show on Firefox on Linux

    Short demonstration what I mean: https://i.imgur.com/q4PR6nc.gif

    It works on Chromium. I use arch linux with newest firefox. Haven't tested other operating systems.

  • 7

    [Feature Request] Supporting grid column sizes for various device sizes

    Currently chota do not support column sizes for various device sizes, mobile(sm), tablet(md), desktop(xl). This can be achieved with small effort and will be a useful feature

  • 8

    Importing Chota core from CDN using CSS @import does not work

    The docs show the "quick start" method of using Chota without installing locally, by referring to the CSS file on a CDN-

    <link rel="stylesheet" href="https://unpkg.com/[email protected]">

    When I tried to do the same thing by using an @import statement at the head of my local CSS file, I could not get it to work.

    Having done some searching on the net, I found a similar issue discussed here-

    The discussion on Stackexchange indcates that the issues is caused by the CDN delivering the CSS file with the wrong MIME type (in their case as text/plain instead of text/css). I have not been able to verify that this is what's happening with Chota, but something similar seems likely.

  • 9

    Custom scrollbar

    On macOS, scrollbars are pretty neat and appealing, but on Windows, you have something like this

    • https://prnt.sc/v6u9z1 (chrome)
    • https://prnt.sc/v6udxc (firefox)

    And even worse looking in the dark theme

    • https://prnt.sc/v6uegp (chrome)
    • https://prnt.sc/v6uesf (firefox)

    So I want to add custom scrollbar (using CSS only of course). Scrollbar may use --color-lightGrey as an accent color

    • https://prnt.sc/v6ugwv
    • https://prnt.sc/v6uhzi

    Or --color-primary

    • https://prnt.sc/v6uik3
    • https://prnt.sc/v6uiqr

    Scrollbar obviously would change color scheme based on values of custom properties. It's pretty cool too IMO.


    Almost all browsers, that you currently support, support this functionality, except for Edge (supports only from version 79) and IE. Scrollbars would have a default look there.


    Also, this addition will not significantly affect the library size.

  • 10

    Add `.grouped.gapless` class

    This PR add support for the .grouped.gapless class that allow to group elements (input, select, button ...)

    Preview

    image

    <kbd>button</kbd>:
    <div>
    	<button class=button>Left</button>
    	<button class=button>Center</button>
    	<button class=button>Right</button>
    </div>
    
    <kbd>.grouped > button</kbd>:
    <div class="grouped">
    	<button class=button>Left</button>
    	<button class=button>Center</button>
    	<button class=button>Right</button>
    </div>
    <kbd>.grouped.gapless > .button.icon-only</kbd>:
    <div class="grouped gapless">
    	<button class="button icon-only"><img src="https://icongr.am/clarity/align-left-text.svg?size=18"></button>
    	<button class="button icon-only"><img src="https://icongr.am/clarity/center-text.svg?size=18"></button>
    	<button class="button icon-only"><img src="https://icongr.am/clarity/align-right-text.svg?size=18"></button>
    </div>
    <kbd>.grouped.gapless > .button.outline.primary</kbd>:
    <div class="grouped gapless">
    	<a class="button icon-only outline">&laquo;</a>
    	<a class="button icon-only outline">1</a>
    	<a class="button icon-only outline">2</a>
    	<a class="button icon-only outline primary">3</a>
    	<a class="button icon-only outline">4</a>
    	<a class="button icon-only outline">&raquo;</a>
    </div>
    <kbd>.grouped.gapless > .col-2</kbd>:
    <form class="grouped gapless">
    	<select class=col-2>
    		<option>Track
    		<option>Artist
    		<option>Playlist
    	</select>
    	<input type=search placeholder=search>
    	<input type=submit>
    </form>
    
  • 11

    `.nav a and .nav .brand` should not have a fixed color

    Shouldn't the color property of .nav a, .nav .brand be depending on previously defined variables? Maybe use color: var(--color-darkGrey); like it's used for .tabs > a?

  • 12

    radio buttons in safari are truncated

    in safari 16.2 (latest) the radio buttons of the demo page are truncated:

    Screenshot 2022-12-19 at 21 42 00

    for the height: 1.6rem; the width has to be at least 1.9rem to fit.

    i was wondering if a "full on" css approach would be a good idea to unify the look in all major browsers? e.g. https://moderncss.dev/pure-css-custom-styled-radio-buttons/

  • 13

    TIP: Masonry layout

    Adding this code-snippet to a row:

    .row {
      flex-direction: column;
      max-height: 1000px;
    }
    

    It works only between the fixed height. Someone knows how made a masonry-layout in Chota without the fixed height?

  • 14

    Bump minimatch from 3.0.4 to 3.1.2

    Bumps minimatch from 3.0.4 to 3.1.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

  • 15

    errors in documentation

    The grid system is a fluid system, Description for the grid system the describe the size of columns by .col-n but when you have mention that Each column class is named after how many columns you want out of 12. So if you want 4 columns out of 12, use .col-4 either if you want 3 columns out of 12. use col-4. If this typing mistake then i can resolve this issue.

  • 16

    Bump commonmarker from 0.23.5 to 0.23.6

    Bumps commonmarker from 0.23.5 to 0.23.6.

    Release notes

    Sourced from commonmarker's releases.

    v0.23.6

    What's Changed

    This release includes two updates from the upstream cmark-gfm library, namely:

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.