All Projects → gadfly361 → breaking-point

gadfly361 / breaking-point

Licence: other
BREAKING-POINT lets you quickly define and subscribe to screen (i.e. window) breakpoints in your re-frame application

Programming Languages

clojure
4091 projects
HTML
75241 projects

Projects that are alternatives of or similar to breaking-point

Flexi
Just a layout framework. Design for cross-platform with ease.
Stars: ✭ 220 (+511.11%)
Mutual labels:  responsive, breakpoint
responsivebootstrap
This is the repository for my course, Bootstrap Layouts: Responsive Single-Page Design on LinkedIn Learning and Lynda.com.
Stars: ✭ 49 (+36.11%)
Mutual labels:  responsive, responsive-design
Minwiz
Minimal starter kit for under 2 KB sites
Stars: ✭ 228 (+533.33%)
Mutual labels:  responsive, responsive-design
Mq Scss
Extremely powerful Sass media query mixin. Allows you to create almost any media query you can imagine.
Stars: ✭ 122 (+238.89%)
Mutual labels:  responsive, breakpoint
pichichi
Simple one page responsive portfolio template
Stars: ✭ 54 (+50%)
Mutual labels:  responsive, responsive-design
Paper Kit 2 Angular
Free Bootstrap 4 UI Kit for Angular 2+
Stars: ✭ 133 (+269.44%)
Mutual labels:  responsive, responsive-design
re-frame-semantic-ui-react-github-widget
Using semantic-ui-react with re-frame - sample project
Stars: ✭ 21 (-41.67%)
Mutual labels:  reagent, re-frame
Vue Responsive
A plugin for responsive handling with vue.js
Stars: ✭ 86 (+138.89%)
Mutual labels:  responsive, responsive-design
just-responsive-images
WordPress Plugin to support better responsive images with <picture> tag, backgrounds, retina support etc.
Stars: ✭ 47 (+30.56%)
Mutual labels:  responsive, responsive-design
re-frame-realword-example-app
Exemplary real world application built with Clojurescript and re-frame
Stars: ✭ 16 (-55.56%)
Mutual labels:  reagent, re-frame
Container Query
A PostCSS plugin and Javascript runtime combination, which allows you to write container queries in your CSS the same way you would write media queries.
Stars: ✭ 119 (+230.56%)
Mutual labels:  responsive, responsive-design
ionic-login-component
Free sample of Premium Ionic Login Component
Stars: ✭ 17 (-52.78%)
Mutual labels:  responsive, responsive-design
React Flexa
Responsive React Flexbox (CSS Flexible Box Layout Module) grid system based heavily on the standard CSS API.
Stars: ✭ 120 (+233.33%)
Mutual labels:  responsive, breakpoint
Argon Design System
Argon - Design System for Bootstrap 4 by Creative Tim
Stars: ✭ 2,307 (+6308.33%)
Mutual labels:  responsive, responsive-design
Match Media
Universal polyfill for match media API using Expo APIs on mobile
Stars: ✭ 95 (+163.89%)
Mutual labels:  responsive, breakpoint
React Native Responsive Dimensions
Resposive fontSize, height and width for react-native components, that automatically adjusts itself based on screen-size of the device.
Stars: ✭ 243 (+575%)
Mutual labels:  responsive, responsive-design
Flutterwebsite
The flutter.dev website recreated in Flutter. https://gallery.codelessly.com/flutterwebsites/flutterwebsite
Stars: ✭ 76 (+111.11%)
Mutual labels:  responsive, responsive-design
Easygrid
EasyGrid - VanillaJS Responsive Grid
Stars: ✭ 77 (+113.89%)
Mutual labels:  responsive, responsive-design
styled-media-helper
💅 Helps manage media queries with styled components
Stars: ✭ 76 (+111.11%)
Mutual labels:  breakpoint, breakpoints
rn-shadow-steroid
React Native with shadow-cljs on steroids
Stars: ✭ 57 (+58.33%)
Mutual labels:  reagent, re-frame

BREAKING-POINT

" I don’t know; every man has his breaking point."

  • Red, The Shawshank Redemption

BREAKING-POINT lets you quickly define and subscribe to screen breakpoints in your re-frame application.

Add the following to the :dependencies vector in your project.clj file.

[breaking-point "0.1.2"]

And in your ns:

(ns your-ns
  (:require [breaking-point.core :as bp]))

breaking-point gif not found

API

::bp/set-breakpoints

::bp/set-breakpoints takes a hash-map with the following shape:

key type default required?
:breakpoints [keyword int keyword int ... keyword] yes
:debounce-ms int 0 no

Breakpoints takes a series of keywords alternating with ints that will be used as breakpoints. Make sure the breakpoints are ascending in value. Here is an example:

(re-frame/dispatch-sync [::bp/set-breakpoints
                         {;; required
                          :breakpoints [:mobile
                                        768
                                        :tablet
                                        992
                                        :small-monitor
                                        1200
                                        :large-monitor]

                          ;; optional
                          :debounce-ms 166
                          }])

You can have as many breakpoints as you want and name them whatever you want, just be sure to alternate keywords with ascending ints.

When you disptach ::bp/set-breakpoints, it will register subscriptions based on the provided keywords and breakpoints that you supplied.

(re-frame/subscribe [::bp/screen-width]) ;; will be an int
(re-frame/subscribe [::bp/screen-height]) ;; will be an int
(re-frame/subscribe [::bp/screen]) ;; will be one of the following: :mobile, :tablet, :small-monitor, :large-monitor

(re-frame/subscribe [::bp/orientation]) ;; will be either :portrait or :landscape
(re-frame/subscribe [::bp/landscape?]) ;; true if width is >= height
(re-frame/subscribe [::bp/portrait?]) ;; true if height > width

;; these will be based on the breakpoint names that you provide
(re-frame/subscribe [::bp/mobile?]) ;; true if screen-width is < 768
(re-frame/subscribe [::bp/tablet?]) ;; true if screen-width is >= 768 and < 992
(re-frame/subscribe [::bp/small-monitor?]) ;; true if window width is >= 992 and < 1200
(re-frame/subscribe [::bp/large-monitor?]) ;; true if window width is >= 1200

Note, ::bp/set-breakpoints should only be dispatched once when the application first loads.

Usage

Create a new re-frame application and add the +breaking-point option.

lein new re-frame foo +breaking-point

Questions

If you have questions, I can usually be found hanging out in the clojurians #reagent slack channel (my handle is @gadfly361).

License

Copyright © 2018 Matthew Jaoudi

Distributed under the The MIT License (MIT).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].