Giter Site home page Giter Site logo

fartcss's Introduction

fartcss

Inspired by TailwindCSS

fart.css is a small set of utility classes to help with responsive web design that leverage EQCSS to allow authors to set element-based breakpoints (using element queries and container queries).

The framework introduces a number of HTML attributes that can be used anywhere which are composed of three parts:

  • min or max
  • condition being queried
  • breakpoint

This means when writing styles for a breakpoint you want to have happen when an element reaches a width of at least 500px, you could add the attribute min-width-500="" to your element. Any CSS properties set to the value of this attribute will apply when the breakpoint is true. In the following example, our div element would turn blue when it was wider than 500px:

<div min-width-500="background: blue">fart.css demo</div>

This is because in our fart.css stylesheet there's the following EQCSS element query:

@element [min-width-500] and (min-width: 500px) {
  $this { eval('getAttribute("min-width-500")') }
}

This means whenever the (min-width: 500px) breakpoint is true for any element in the page with a [min-width-500] attribute, the value of that attribute eval('getAttribute("min-width-500")') gets used as the content of a rule for $this, which refers to each individual element matching the breakpoint separately.

Available Attributes

Width-based

  • min-width-100
  • min-width-200
  • min-width-300
  • min-width-400
  • min-width-500
  • min-width-600
  • min-width-700
  • min-width-800
  • min-width-900
  • min-width-1000
  • max-width-100
  • max-width-200
  • max-width-300
  • max-width-400
  • max-width-500
  • max-width-600
  • max-width-700
  • max-width-800
  • max-width-900
  • max-width-1000

Height-based

  • min-height-100
  • min-height-200
  • min-height-300
  • min-height-400
  • min-height-500
  • min-height-600
  • min-height-700
  • min-height-800
  • min-height-900
  • min-height-1000
  • max-height-100
  • max-height-200
  • max-height-300
  • max-height-400
  • max-height-500
  • max-height-600
  • max-height-700
  • max-height-800
  • max-height-900
  • max-height-1000

Children-based

  • min-children-1
  • min-children-2
  • min-children-3
  • min-children-4
  • min-children-5
  • min-children-6
  • min-children-7
  • min-children-8
  • min-children-9
  • min-children-10
  • max-children-1
  • max-children-2
  • max-children-3
  • max-children-4
  • max-children-5
  • max-children-6
  • max-children-7
  • max-children-8
  • max-children-9
  • max-children-10

Links

fartcss's People

Contributors

tomhodgins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

niilante

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.