Skip to content

Instantly share code, notes, and snippets.

View chandu0101's full-sized avatar

Chandra Sekhar Kode chandu0101

  • Vijayawada,India
View GitHub Profile
//style attr ( flex,padding,..)
case class NativeStyle[T](name : String) {
def := (v :T) = new NativeStylePair[T](name,v)
}
// style attr and value pair (flex = 1 , alignItems = center)
case class NativeStylePair[T](key : String ,value : T)
// define supported css attrs with corresponding type
trait NativeAttrs {
object ReactListView {
class Style extends StyleSheet.Inline {
import dsl._
val listGroup = style(marginBottom(20.px),
paddingLeft.`0`,
&.firstChild.lastChild(borderBottomLeftRadius(4 px),
@chandu0101
chandu0101 / CssPager.scala
Last active November 10, 2015 15:22
ReactPager using scalacss
object CssPager {
type CLICKEVENT = Int => Unit
object Style extends StyleSheet.Inline {
import dsl._
val pager = style(margin(20.px),
unsafeChild(".previous")(float.left),
unsafeChild(".next")(float.right)
)
@chandu0101
chandu0101 / PouchDBFacade.scala
Last active August 29, 2015 14:15
pouchDB scalajs facade
import scala.scalajs.js
import scala.scalajs.js.Dynamic.{literal => json}
import scala.scalajs.js.annotation.JSName
/**
* Created by chandrasekharkode .
*/
@chandu0101
chandu0101 / ReactDefaultSeelct.scala
Last active August 29, 2015 14:15
select component scalajs-react
object DefaultSelect {
class Backend(t: BackendScope[Props, _]) {
def onChange(e:ReactEventI) = t.props.onChange(e.target.value)
}
val component = ReactComponentB[Props]("DefaultSelect")
.stateless
.backend(new Backend(_))
@chandu0101
chandu0101 / gist:482ddd4381e09dd12de4
Created February 10, 2015 22:58
scalajs-react custom tags style
/**
* Created by chandrasekharkode
*
* Eventually these should be copied to scalajs-react core
*/
trait RCustomTags {
/* styles */
val webkitTransform = "webkitTransform".reactStyle
@chandu0101
chandu0101 / ReactSearchbox.scala
Created January 30, 2015 03:52
scalajs-react with inline style example
/**
* Created by chandrasekharkode .
*/
object ReactSearchBox {
trait Style {
def searchBox : TagMod = Seq( position := "relative" ,
marginBottom := "10px")
@chandu0101
chandu0101 / bootstrap-class-names-list-scala
Last active August 29, 2015 14:10
Bootstrapcss class names list
/**
* version 3.2
*
* table class is renamed as csstable because it conflicts with scalatags
*/
object BootstrapCSS {