Skip to content

Instantly share code, notes, and snippets.

@scalway
Last active May 19, 2018 19:06
Show Gist options
  • Save scalway/1efe2364ee93076ebe6fa8be417ccfd9 to your computer and use it in GitHub Desktop.
Save scalway/1efe2364ee93076ebe6fa8be417ccfd9 to your computer and use it in GitHub Desktop.
bootstrap3 scalatags pug'like heler.
/**
* Copyright 2017 Scalway Krzysztof Pecyna
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
package jsutils.b3
import jsutils.b3.JsDom.{E, TAG, createGlyphicon}
import scalatags.text.Builder
import org.scalajs.dom
import org.scalajs.dom.html.{Button, Div, Span}
import scalatags.JsDom.all.Modifier
object JsDom extends {
import scalatags.JsDom.{all => st}
type E = dom.Element
type TAG[T <: E] = scalatags.JsDom.TypedTag[T]
def create[T <: E](v: TAG[T]) = new Bootstrap3[TAG[T],T](v)
def createGlyphicon[T <: E](v: TAG[T]) = new GlyphiconsImpl[TAG[T],T](v)
class ClsAppender(name:String) extends Modifier {
override def applyTo(t: dom.Element): Unit = t.classList.add(name)
}
protected class Short[API[_]] {
object short {
val div = create[Div](st.div)
val button = create[Button](st.button)
val span = create[Span](st.span)
}
}
object all extends Short[Bootstrap3Abs] { implicit def tte2Bootsrap_all[T<:E](t:TAG[T]):Bootstrap3Abs[TAG[T]] = create(t) }
object helpers extends Short[HelperClasses] { implicit def tte2Bootsrap_helperClasses[T<:E](t:TAG[T]):HelperClasses[TAG[T]] = create(t) }
object navbars extends Short[Navbar] { implicit def tte2Bootsrap_navbar[T<:E](t:TAG[T]):Navbar[TAG[T]] = create(t) }
object buttons extends Short[Buttons] { implicit def tte2Bootsrap_buttons[T<:E](t:TAG[T]):Buttons[TAG[T]] = create(t) }
object gridSystem extends Short[GridSystem] { implicit def tte2Bootsrap_gridSystem[T<:E](t:TAG[T]):GridSystem[TAG[T]] = create(t) }
object modals extends Short[Modals] { implicit def tte2Bootsrap_modals[T<:E](t:TAG[T]):Modals[TAG[T]] = create(t) }
object forms extends Short[Forms] { implicit def tte2Bootsrap_forms[T<:E](t:TAG[T]):Forms[TAG[T]] = create(t) }
object typography extends Short[Typography] { implicit def tte2Bootsrap_typography[T<:E](t:TAG[T]):Typography[TAG[T]] = create(t) }
object panels extends Short[Panels] { implicit def tte2Bootsrap_panels[T<:E](t:TAG[T]):Panels[TAG[T]] = create(t) }
object listGroup extends Short[ListGroup] { implicit def tte2Bootsrap_listGroup[T<:E](t:TAG[T]):ListGroup[TAG[T]] = create(t) }
object dropdowns extends Short[Dropdowns] { implicit def tte2Bootsrap_dropdowns[T<:E](t:TAG[T]):Dropdowns[TAG[T]] = create(t) }
object carousel extends Short[Carousel] { implicit def tte2Bootsrap_carousel[T<:E](t:TAG[T]):Carousel[TAG[T]] = create(t) }
object other extends Short[Other] { implicit def tte2Bootsrap_other[T<:E](t:TAG[T]):Other[TAG[T]] = create(t) }
object glyphicon {
object short {
val i = createGlyphicon(st.i)
}
implicit def tte2Bootsrap_other[T<:E](t:TAG[T]):Glyphicons[TAG[T]] = createGlyphicon(t)
}
}
object Text {
import scalatags.Text.{all => st}
protected type E = String
protected type TAG[T <: E] = scalatags.Text.TypedTag[T]
def create[T <: E](v: TAG[T]) = new Bootstrap3Text[TAG[T],T](v)
def createGlyphicon[T <: E](v: TAG[T]) = new GlyphiconsImplText[TAG[T],T](v)
protected class Short[API[_]] {
object short {
val div = create(st.div)
val button = create(st.button)
val span = create(st.span)
}
}
object all extends Short[Bootstrap3Abs] { implicit def tte2Bootsrap_all[T<:E](t:TAG[T]):Bootstrap3Abs[TAG[T]] = create(t) }
object helpers extends Short[HelperClasses] { implicit def tte2Bootsrap_helperClasses[T<:E](t:TAG[T]):HelperClasses[TAG[T]] = create(t) }
object navbars extends Short[Navbar] { implicit def tte2Bootsrap_navbar[T<:E](t:TAG[T]):Navbar[TAG[T]] = create(t) }
object buttons extends Short[Buttons] { implicit def tte2Bootsrap_buttons[T<:E](t:TAG[T]):Buttons[TAG[T]] = create(t) }
object gridSystem extends Short[GridSystem] { implicit def tte2Bootsrap_gridSystem[T<:E](t:TAG[T]):GridSystem[TAG[T]] = create(t) }
object modals extends Short[Modals] { implicit def tte2Bootsrap_modals[T<:E](t:TAG[T]):Modals[TAG[T]] = create(t) }
object forms extends Short[Forms] { implicit def tte2Bootsrap_forms[T<:E](t:TAG[T]):Forms[TAG[T]] = create(t) }
object typography extends Short[Typography] { implicit def tte2Bootsrap_typography[T<:E](t:TAG[T]):Typography[TAG[T]] = create(t) }
object panels extends Short[Panels] { implicit def tte2Bootsrap_panels[T<:E](t:TAG[T]):Panels[TAG[T]] = create(t) }
object listGroup extends Short[ListGroup] { implicit def tte2Bootsrap_listGroup[T<:E](t:TAG[T]):ListGroup[TAG[T]] = create(t) }
object carousel extends Short[Carousel] { implicit def tte2Bootsrap_carousel[T<:E](t:TAG[T]):Carousel[TAG[T]] = create(t) }
object dropdowns extends Short[Dropdowns] { implicit def tte2Bootsrap_dropdowns[T<:E](t:TAG[T]):Dropdowns[TAG[T]] = create(t) }
object other extends Short[Other] { implicit def tte2Bootsrap_other[T<:E](t:TAG[T]):Other[TAG[T]] = create(t) }
object glyphicon {
implicit def tte2Bootsrap_glyphicons[T<:E](t:TAG[T]):Glyphicons[TAG[T]] = createGlyphicon(t)
object short {
val i = createGlyphicon(st.i)
}
}
class ClsAppender(name: String) extends scalatags.Text.Modifier {
override def applyTo(t: Builder): Unit = {
t.appendAttr("class", Builder.GenericAttrValueSource(" " + name))
}
}
}
private[b3] trait Bootstrap3Abs[R] extends Any
with Api[R]
with HelperClasses[R]
with Navbar[R]
with Buttons[R]
with GridSystem[R]
with Modals[R]
with Forms[R]
with Typography[R]
with Panels[R]
with ListGroup[R]
with Dropdowns[R]
with Carousel[R]
with Other[R]
/** description comes from https://bootstrapcreative.com/resources/bootstrap-3-css-classes-index/ **/
private[b3] class Bootstrap3[R <: scalatags.JsDom.TypedTag[T],T <: dom.Element](val obj:scalatags.JsDom.TypedTag[T]) extends AnyVal with Bootstrap3Abs[scalatags.JsDom.TypedTag[T]] {
protected def cls(name:String):scalatags.JsDom.TypedTag[T] = obj(new JsDom.ClsAppender(name))
}
private[b3] class GlyphiconsImpl[R <: scalatags.JsDom.TypedTag[T], T <:dom.Element](val obj:R) extends AnyVal with Glyphicons[scalatags.JsDom.TypedTag[T]] {
protected def cls(name:String):scalatags.JsDom.TypedTag[T] = obj(new JsDom.ClsAppender("glyphicon"), new JsDom.ClsAppender(name))
}
/** description comes from https://bootstrapcreative.com/resources/bootstrap-3-css-classes-index/ **/
private[b3] class Bootstrap3Text[R <: scalatags.Text.TypedTag[T],T <: String](val obj:scalatags.Text.TypedTag[T]) extends AnyVal with Bootstrap3Abs[scalatags.Text.TypedTag[T]] {
protected def cls(name:String):scalatags.Text.TypedTag[T] = obj(new Text.ClsAppender(name))
}
private[b3] class GlyphiconsImplText[R <: scalatags.Text.TypedTag[T], T <: String](val obj:R) extends AnyVal with Glyphicons[scalatags.Text.TypedTag[T]] {
protected def cls(name:String):scalatags.Text.TypedTag[T] = obj(new Text.ClsAppender("glyphicon"), new Text.ClsAppender(name))
}
private[b3] trait Api[R] extends Any {
protected def cls(name: String): R
}
private[b3] trait HelperClasses[R] extends Any with Api[R] {
def bg:R = cls("bg")
/** bootstrap bg_danger Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. Helper Classes **/
def bgDanger:R = cls("bg-danger")
/** bootstrap bg_info Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. Helper Classes **/
def bgInfo:R = cls("bg-info")
/** bootstrap bg_primary Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. Helper Classes **/
def bgPrimary:R = cls("bg-primary")
/** bootstrap bg_success Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. Helper Classes **/
def bgSuccess:R = cls("bg-success")
/** bootstrap bg_warning Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. Helper Classes **/
def bgWarning:R = cls("bg-warning")
/** bootstrap center block add width and height to center a block level element Helper Classes **/
def centerBlock:R = cls("center-block")
/** Used to clear floats by adding .cleafix to the parent element. It adds a pseudo element with clear:both property. Helper Classes **/
def clearfix:R = cls("clearfix ")
/** bootstrap btn close Use the generic close icon for dismissing content like modals and alerts. Helper Classes **/
def close:R = cls("close")
/** bootstrap hidden hides an element everywhere Helper Classes **/
def hidden:R = cls("hidden")
/** bootstrap Make something invisible Helper Classes **/
def invisible:R = cls("invisible")
/** bootstrap Float element to the left Helper Classes **/
def pullLeft:R = cls("pull-left")
/** bootstrap Float element to the right Helper Classes **/
def pullRight:R = cls("pull-right")
/** bootstrap show show hidden element Helper Classes **/
def show:R = cls("show")
/** Bootstrap classes list with description Hide an element to all devices except screen readers with .sr_only. Helper Classes **/
def srOnly:R = cls("sr-only")
}
private[b3] trait Navbar[R] extends Any with Api[R] {
/** bootstrap left Align nav links, forms, buttons, or text, using the .navbar_left or .navbar_right utility classes. Both classes will add a CSS float in the specified direction. Navbar **/
def navbarLeft:R = cls("navbar-left")
/** bootstrap right Align nav links, forms, buttons, or text, using the .navbar_left or .navbar_right utility classes. Both classes will add a CSS float in the specified direction. Navbar **/
def navbarRight:R = cls("navbar-right")
/** bootstrap icon bar Used in the navbar to make the cheeseburger mobile menu Navbar **/
def iconBar:R = cls("icon-bar")
/** bootstrap navbar Navigation header class Navbar **/
def navbar:R = cls("navbar")
/** bootstrap navbar brand Most navbars contain a logo or brand. This class is added to the anchor Navbar **/
def navbarBrand:R = cls("navbar-brand")
/** bootstrap navbar buttons Vertically aligns a button inside a navbar Navbar **/
def navbarBtn:R = cls("navbar-btn")
/** bootstrap The content inside the navbar that will be hidden with the mobile nav toggle is enabled Navbar **/
def navbarCollapse:R = cls("navbar-collapse")
/** bootstrap The default navbar configuration styles Navbar **/
def navbarDefault:R = cls("navbar-default")
/** bootstrap navbar fixed footer Fixes the footer to the bottom of the window Navbar **/
def navbarFixedBottom:R = cls("navbar-fixed-bottom")
/** bootstrap navbar static top Affixes the navbar to the top of the window Navbar **/
def navbarFixedTop:R = cls("navbar-fixed-top")
/** bootstrap navbar form Wrap form elements with this class so that they are vertically center Navbar **/
def navbarForm:R = cls("navbar-form")
/** bootstrap This class contains the brand image or text and the mobile toggle icons Navbar **/
def navbarHeader:R = cls("navbar-header")
/** bootstrap Modify the look of the navbar by inverting the colors Navbar **/
def navbarInverse:R = cls("navbar-inverse")
/** bootstrap navbar link Use the .navbar_link class to add the proper colors for the default and inverse navbar options. Navbar **/
def navbarLink:R = cls("navbar-link")
/** bootstrap navbar nav The wrapper class of the navigation elements excluding the brand Navbar **/
def navbarNav:R = cls("navbar-nav")
/** bootstrap static top Create a full_width navbar that scrolls away with the page by adding .navbar_static_top and include a .container or .container_fluid to center and pad navbar content. Navbar **/
def navbarStaticTop:R = cls("navbar-static-top")
/** bootstrap navbar text Wrap strings of text in an element with .navbar_text, usually on atag for proper leading and color. Navbar **/
def navbarText:R = cls("navbar-text")
/** bootstrap The class the wraps the mobile toggle icon (cheeseburger icon) Navbar **/
def navbarToggle:R = cls("navbar-toggle")
}
private[b3] trait Buttons[R] extends Any with Api[R] {
/** bootstrap btn This class sets the spacing and size of the button. Buttons **/
def btn:R = cls("btn")
/** bootstrap btn block By default buttons are inline this class makes it block to span the full width of its parent. Buttons **/
def btnBlock:R = cls("btn-block")
/** bootstrap btn danger Defaults to a red background button Buttons **/
def btnDanger:R = cls("btn-danger")
/** bootstrap btn default Defaults to a white background button with dark border. Buttons **/
def btnDefault:R = cls("btn-default")
/** bootstrap btn info Button for information on a topic like terms and conditions. Default is light blue. Buttons **/
def btnInfo:R = cls("btn-info")
/** bootstrap btn primary Use for the primary action in a set. Buttons **/
def btnPrimary:R = cls("btn-primary")
/** bootstrap btn success Defaults to a green background button with dark border. Buttons **/
def btnSuccess:R = cls("btn-success")
/** bootstrap btn warning Defaults to a yellow background button with dark border. Buttons **/
def btnWarning:R = cls("btn-warning")
/** bootstrap btn lg Fancy larger or smaller buttons? Add .btn_lg, .btn_sm, or .btn_xs for additional sizes. Buttons **/
def btnLg:R = cls("btn-lg")
/** bootstrap btn sm Fancy larger or smaller buttons? Add .btn_lg, .btn_sm, or .btn_xs for additional sizes. Buttons **/
def btnSm:R = cls("btn-sm")
/** bootstrap btn xs Fancy larger or smaller buttons? Add .btn_lg, .btn_sm, or .btn_xs for additional sizes. Buttons **/
def btnXs:R = cls("btn-xs")
/** bootstrap btn link Keeps the spacing set with the .btn class but removes the outer border. Buttons **/
def btnLink:R = cls("btn-link")
/** bootstrap btn group Smushes multiple buttons together to make a pill shape. Each button is separated by a vertical line. Button groups **/
def btnGroup:R = cls("btn-group")
/** bootstrap btn group justified Make a group of buttons stretch at equal sizes to span the entire width of its parent. Also works with button dropdowns within the button group. Button groups **/
def btnGroupJustified:R = cls("btn-group-justified")
/** bootstrap btn group vertical Make a set of buttons appear vertically stacked rather than horizontally. Button groups **/
def btnGroupVertical:R = cls("btn-group-vertical")
/** bootstrap btn toolbar Used to create a row of buttons similar pagination row Button groups **/
def btnToolbar:R = cls("btn-toolbar")
}
private[b3] trait GridSystem[R] extends Any with Api[R] {
/**bootstrap col span 1_12 column. Extra small devices Phones ( < 768px), Small devices Tablets (≥768px), Medium devices Desktops (≥992px), Large devices Desktops (≥1200px). Column device Column numeric values can be 1_12. Grid system **/
def colXs(num:Int):R = cls("col-xs-" + num)
def colSm(num:Int):R = cls("col-sm-" + num)
def colMd(num:Int):R = cls("col-md-" + num)
def colLg(num:Int):R = cls("col-lg-" + num)
/**bootstrap col offset Move columns to the right using .col_lg_offset_* classes. These classes increase the left margin of a column by * columns. For example, .col_lg_offset_4 moves .col_lg_4 over four columns. Offset numeric values can be 0_12 Grid system **/
def colXsOffset(num:Int):R = cls("col-xs-offset" + num)
def colSmOffset(num:Int):R = cls("col-sm-offset" + num)
def colMdOffset(num:Int):R = cls("col-md-offset" + num)
def colLgOffset(num:Int):R = cls("col-lg-offset" + num)
/**_*_pull_* bootstrap pull Easily change the order of our built_in grid columns with .col_*_push_* and .col_*_pull_* modifier classes. Pull numeric values can be 0_12. Grid system **/
def colXsPull(num:Int):R = cls("col-xs-pull-" + num)
def colSmPull(num:Int):R = cls("col-sm-pull-" + num)
def colMdPull(num:Int):R = cls("col-md-pull-" + num)
def colLgPull(num:Int):R = cls("col-lg-pull-" + num)
/**_*_push_* bootstrap push Easily change the order of our built_in grid columns with .col_*_push_* and .col_*_pull_* modifier classes. Push numeric values can be 0_12. Grid system **/
def colXsPush(num:Int):R = cls("col-xs-push-" + num)
def colSmPush(num:Int):R = cls("col-sm-push-" + num)
def colMdPush(num:Int):R = cls("col-md-push-" + num)
def colLgPush(num:Int):R = cls("col-lg-push-" + num)
/** bootstrap container Fixed width container with widths determined by screen sites. Equal margin on the left and right. Grid system **/
def container:R = cls("container")
/** bootstrap container fluid Spans the full width of the screen Grid system **/
def containerFluid:R = cls("container-fluid")
/** bootstrap row used a parent wrapper of any vertical columns Grid system **/
def row:R = cls("row")
}
private[b3] trait Modals[R] extends Any with Api[R] {
/** bootstrap The parent wrapper class of modal content Modal **/
def modal:R = cls("modal")
/** Bootstrap classes list with description Added by the modal javascript to make the area around the modal clickable to hide the modal Modal **/
def modalBackdrop:R = cls("modal-backdrop")
/** bootstrap The modal body content class : Header _ Body _ Footer Modal **/
def modalBody:R = cls("modal-body")
/** bootstrap modal_content contains modal_body, modal_header, and modal_footer Modal **/
def modalContent:R = cls("modal-content")
/** bootstrap dialog The secondary wrapper class of the entire modal content Modal **/
def modalDialog:R = cls("modal-dialog")
/** bootstrap The footer of the modal that contains action buttons or help text Modal **/
def modalFooter:R = cls("modal-footer")
/** bootstrap The header section of the modal that contains the title and close button Modal **/
def modalHeader:R = cls("modal-header")
/** bootstrap modal large Makes a modal wider Modal **/
def modalLg:R = cls("modal-lg")
/** Bootstrap classes list with description Javascript adds this class to the body tag to prevent scrolling with the modal is open Modal **/
def modalOpen:R = cls("modal-open")
/** bootstrap modal small Makes the modal not as wide Modal **/
def modalSm:R = cls("modal-sm")
/** bootstrap The title of the modal Modal **/
def modalTitle:R = cls("modal-title")
}
private[b3] trait Forms[R] extends Any with Api[R] {
/** bootstrap checkbox form checkbox wrapper _ Checkboxes are for selecting one or several options in a list, while radios are for selecting one option from many. Forms **/
def checkbox:R = cls("checkbox")
/** bootstrap checkbox inline Checkboxes are for selecting one or several options in a list, while radios are for selecting one option from many. Forms **/
def checkboxInline:R = cls("checkbox-inline")
/** bootstrap control label In forms this classes is added to form labels to allow the label to be used for form validation Forms **/
def controlLabel:R = cls("control-label")
/** bootstrap form control Class added input, textarea, and select to make them 100% and responsive Forms **/
def formControl:R = cls("form-control")
/** bootstrap form control feedback A form validation class Forms **/
def formControlFeedback:R = cls("form-control-feedback")
/** bootstrap form control static Lets you add plain text to the right of a label. For example, Email label could have help text Forms **/
def formControlStatic:R = cls("form-control-static")
/** bootstrap form group A div wrapper class that goes around a form input and label Forms **/
def formGroup:R = cls("form-group")
/** bootstrap has feedback You can also add optional feedback icons with the addition of .has_feedback and the right icon. Forms **/
def hasFeedback:R = cls("has-feedback")
/** bootstrap help_block A block of help text that breaks onto a new line and may extend beyond one line. Forms **/
def helpBlock:R = cls("help-block")
/** bootstrap Set heights using classes like .input_lg, and set widths using grid column classes like .col_lg_*. Forms **/
def inputLg:R = cls("input-lg")
/** bootstrap Set heights using classes like .input_lg, and set widths using grid column classes like .col_lg_*. Forms **/
def inputSm:R = cls("input-sm")
/** bootstrap input group Wrapper class used to enhance an input and label group by adding a button in front or behind as help text Input groups **/
def inputGroup:R = cls("input-group")
/** bootstrap input group addon The class added to an icon or help text in an form .input_group Input groups **/
def inputGroupAddon:R = cls("input-group-addon")
/** bootstrap input group btn Attaches a button next to a text input. Would work for a search bar or email optin form. Input groups **/
def inputGroupBtn:R = cls("input-group-btn")
}
private[b3] trait Typography[R] extends Any with Api[R] {
/** _ .h6 bootstrap h1_h6 Apply heading styles to other elements. Make a paragraph look like an h1 Typography **/
def h1:R = cls("h1")
/** bootstrap innitialism Add .initialism to an abbreviation for a slightly smaller font_size. Typography **/
def initialism:R = cls("initialism")
/** bootstrap Increase the font size and line height of a paragraph. Good to use on the first paragraph of an article to improve readability. Typography **/
def lead:R = cls("lead")
/** bootstrap list inline Overrides a lists default style to be inline and block Typography **/
def listInline:R = cls("list-inline")
/** bootstrap list unstyled Removes all bullet styling from a ul or ol list Typography **/
def listUnstyled:R = cls("list-unstyled")
/** bootstrap For highlighting a run of text due to its relevance in another context, use the mark tag. Typography **/
def mark:R = cls("mark")
/** bootstrap small Create lighter, secondary text in any heading with a generic tag or the .small class. Typography **/
def small:R = cls("small")
/** bootstrap text transform Capitalize the text or title case Typography **/
def textCapitalize:R = cls("text-capitalize")
/** bootstrap text alignment Aligns the text to the center Typography **/
def textCenter:R = cls("text-center")
/** Bootstrap classes list with description hides the text _ useful for replacing text with a background image Typography **/
def textHide:R = cls("text-hide")
/** bootstrap text info Changes text color to info variable color Typography **/
def textInfo:R = cls("text-info")
/** bootstrap text danger Changes text color to danger variable color Typography **/
def textDanger:R = cls("text-danger")
/** bootstrap text primary Changes text color to your primary color Typography **/
def textPrimary:R = cls("text-primary")
/** bootstrap text success Changes text color to green or your "success" variable color Typography **/
def textSuccess:R = cls("text-success")
/** bootstrap text warning Changes a text color to your default "warning" color Typography **/
def textWarning:R = cls("text-warning")
/** bootstrap text alignment Full justifys the text Typography **/
def textJustify:R = cls("text-justify")
/** bootstrap text alignment Aligns the text to the left Typography **/
def textLeft:R = cls("text-left")
/** bootstrap text transform Changes text to lowercase Typography **/
def textLowercase:R = cls("text-lowercase")
/** bootstrap text muted Changes text color to gray Typography **/
def textMuted:R = cls("text-muted")
/** bootstrap text alignment Prevents the text from wrapping Typography **/
def textNowrap:R = cls("text-nowrap")
/** bootstrap text alignment Applies text_align:right Typography **/
def textRight:R = cls("text-right")
/** bootstrap text transform Makes text uppercase Typography **/
def textUppercase:R = cls("text-uppercase")
}
private[b3] trait Panels[R] extends Any with Api[R] {
/** bootstrap panel By default, all the .panel does is apply some basic border and padding to contain some content. Panels **/
def panel:R = cls("panel")
/** bootstrap panel Class added to the panel body because there is also a panel heading Panels **/
def panelBody:R = cls("panel-body")
/**_* bootstrap panel colors Change the color of the panel by adding the following: default, primary, info, warning, danger Panels **/
def panelDefault:R = cls("panel")
/** bootstrap panel footer Class added to a panel footer Panels **/
def panelFooter:R = cls("panel-footer")
/** bootstrap panel group Used to group many panels together. This removes the bottom margin below each panel Panels **/
def panelGroup:R = cls("panel-group")
/** bootstrap panel heading Class added to a panel heading area Panels **/
def panelHeading:R = cls("panel-heading")
/** bootstrap panel title Inside a .panel_heading you can add a .panel_title to adjust the styling of the text Panels **/
def panelTitle:R = cls("panel-title")
}
private[b3] trait ListGroup[R] extends Any with Api[R] {
/** bootstrap list group Wrapper ul class that contains li with borders List group **/
def listGroup:R = cls("list-group")
/** bootstrap list group item Class added to each li in a list_group List group **/
def listGroupItem:R = cls("list-group-item")
/** bootstrap list group heading Class added to an anchor or p for a .list_group_item heading List group **/
def listGroupItemHeading:R = cls("list-group-item-heading")
/** bootstrap list group text Class added to an anchor or p for a .list_group_item text under a heading List group **/
def listGroupItemText:R = cls("list-group-item-text")
/**_* bootstrap list group color Change color of list group item by adding one of the following: default, warning, info, danger, primary List group **/
def listGroupItemDefault:R = cls("list-group-item-default")
def listGroupItemPrimary:R = cls("list-group-item-primary")
def listGroupItemSuccess:R = cls("list-group-item-success")
def listGroupItemInfo:R = cls("list-group-item-info")
def listGroupItemWarning:R = cls("list-group-item-warning")
def listGroupItemDanger:R = cls("list-group-item-danger")
/** bootstrap horizontal definition list Makes terms and definitions line up with a center gutter Lists **/
def dlHorizontal:R = cls("dl-horizontal")
/** bootstrap media object Nested media lists would be good used as comments Media object **/
def mediaList:R = cls("media-list")
}
private[b3] trait Dropdowns [R] extends Any with Api[R] {
/** Bootstrap classes list with description On mobile devices, opening a dropdown adds a .dropdown_backdrop as a tap area for closing dropdown menus when tapping outside the menu, a requirement for proper iOS support. This means that switching from an open dropdown menu to a different dropdown menu requires an extra tap on mobile. Dropdown **/
def dropdownBackdrop:R = cls("dropdown-backdrop")
/** bootstrap dropdown header Used to add headers inside the dropdown menu Dropdown **/
def dropdownHeader:R = cls("dropdown-header")
/** bootstrap dropdown menu Adds the default styles for the dropdown menu container Dropdown **/
def dropdownMenu:R = cls("dropdown-menu")
/** bootstrap dropdown toggle This class is added to the button that will have the toggle action applied that will hide and show the dropdown menu Dropdown **/
def dropdownToggle:R = cls("dropdown-toggle")
/** bootstrap dropdown toggle Add this class to change the orientation of the dropdown menu to pop up instead of down Dropdown **/
def dropup:R = cls("dropup")
/** bootstrap btn caret Used in dropdown menus to show open and closed states Dropdowns **/
def caret:R = cls("caret")
/** bootstrap divider Used to separate links in dropdown menus a Dropdowns **/
def divider:R = cls("divider")
/** bootstrap dropdown This class gives you the ability to add a dropdown to navbar, tabs, and pills so you can display a dropdown of additional navigation. Dropdowns **/
def dropdown:R = cls("dropdown")
}
private[b3] trait Carousel [R] extends Any with Api[R] {
/** bootstrap carousel parent carousel class making it position relative Carousel **/
def carousel:R = cls("carousel")
/** bootstrap carousel caption Caption for each slide item Carousel **/
def carouselCaption:R = cls("carousel-caption")
/** bootstrap control Added to each next and previous anchors Carousel **/
def carouselControl:R = cls("carousel-control")
/** bootstrap carousel indicators parent classed added to an ordered list for the little circles showing what slide you are on Carousel **/
def carouselIndicators:R = cls("carousel-indicators")
/** bootstrap carousel inner The div wrapper that contains the carousel slide items Carousel **/
def carouselInner:R = cls("carousel-inner")
/** bootstrap next icons not necessary _ The ..glyphicon_chevron_left and ..glyphicon_chevron_right classes are not necessarily needed for the controls. Bootstrap provides .icon_prev and .icon_next as plain unicode alternatives. Carousel **/
def iconNext:R = cls("icon-next")
/** bootstrap next icons not necessary _ The ..glyphicon_chevron_left and ..glyphicon_chevron_right classes are not necessarily needed for the controls. Bootstrap provides .icon_prev and .icon_next as plain unicode alternatives. Carousel **/
def iconPrev:R = cls("icon-prev")
/** bootstrap Class added to each carousel item Carousel **/
def item:R = cls("item")
/** bootstrap Used to identify the left carousel control Carousel **/
def left:R = cls("left")
/** bootstrap Used in the carousel control to identity the next control Carousel **/
def next:R = cls("next")
/** bootstrap used in the carousel component for previous link Carousel **/
def prev:R = cls("prev")
/** bootstrap Used in the carousel Carousel **/
def right:R = cls("right")
}
private[b3] trait Other[R] extends Any with Api[R] {
protected def cls(name:String):R
/** bootstrap alert Similar to a well it is a box with a border and padding. The .alert class adds the padding and margin. Alerts **/
def alert:R= cls("alert")
/** bootstrap alert dismissable Similar to a well it is a box with a border and padding. This class and a child element with a .close class lets the user close the alert. Alerts **/
def alertDismissible:R = cls("alert-dismissible")
/** bootstrap alert link When you add links inside alert this class matches the font color to the parent alert class. Alerts **/
def alertLink:R = cls("alert-link")
/**
* Adds a grey background color to the table row (<tr> or table cell (<td>) (same color used on hover) | Tables
* Adds a gray background color to the active link in a default navbar. Adds a black background and a white color to the current link inside an inverted navbar. | Navbar
* Adds a blue background color to the active list item in a list group | List Groups
* Adds a blue background color to simulate a "pressed" button | Buttons
* Animates a striped progress bar | Progress Bars
* Adds a blue background color to the active dropdown item in a dropdown | Dropdowns
* Adds a blue background color to the active pagination link (to highlight the current page)
**/
def active:R = cls("active")
/** bootstrap arrow popover option _ .arrow will become the popover's arrow. Popover **/
def arrow:R = cls("arrow")
/** bootstrap badges Used to show new or unread messages or items like the iOS red icon showing new messages or email. Badges **/
def badge:R = cls("badge")
/** bootstrap breadcrumbs Indicate the current page's location within a navigational hierarchy. Breadcrumbs **/
def breadcrumb:R = cls("breadcrumb")
/** bootstrap caption thumbnail caption but could be used elsewhere Thumbnails **/
def caption:R = cls("caption")
/** bootstrap collapse hides content on hide and show component Collapse **/
def collapse:R = cls("collapse")
/** bootstrap collapsing applied during transitions on hide and show component Collapse **/
def collapsing:R = cls("collapsing")
/** bootstrap danger Tables contextual class to change row color Tables **/
def danger:R = cls("danger")
/**
* Disables a button (adds opacity and a "no-parking-sign" icon on hover) | Buttons
* Disables a dropdown item (adds a grey text color and a "no-parking-sign" icon on hover) | Dropdowns
* Disables a pagination link (cannot be clicked - adds a grey text color and a "no-parking-sign" icon on hover) | Pagination
* Disables a list item in a list group (cannot be clicked - adds a grey background color and a "no-parking-sign" icon on hover) | List Groups
*/
def disabled:R = cls("disabled")
/** bootstrap responsive embed The default responsive iframe embed styles Responsive embed **/
def embedResponsive:R = cls("embed-responsive")
/** bootstrap responsive embed Div wrapper class to make child iframe responsive Responsive embed **/
def embedResponsive16By9:R = cls("embed-responsive-16by9")
/** bootstrap responsive embed Div wrapper class to make child iframe responsive Responsive embed **/
def embedResponsive4By3:R = cls("embed-responsive-4by3")
/** bootstrap fade To have your alerts use animation when closing, make sure they have the .fade and .in classes already applied to them. Alert **/
def fade:R = cls("fade")
/**_* bootstrap hidden visible Use a single or combination of the available classes for toggling content across viewport breakpoints. Can us lg, md, sm. xs Responsive Utilities **/
def hiddenXs:R = cls("hidden-xs")
def hiddenSm:R = cls("hidden-sm")
def hiddenMd:R = cls("hidden-md")
def hiddenLg:R = cls("hidden-lg")
/** bootstrap hidden print Similar to the regular responsive classes, use these for toggling content for print. Responsive Utilities **/
def hiddenPrint:R = cls("hidden-print")
/** bootstrap image circle Crops an image to be a circle Images **/
def imgCircle:R = cls("img-circle")
/** bootstrap image rounded Adds rounded corners to an image Images **/
def imgRounded:R = cls("img-rounded")
/** bootstrap image thumbnail Adds rounded corners and an inset border to an image Images **/
def imgThumbnail:R = cls("img-thumbnail")
/** bootstrap in To make tabs fade in, add .fade to each .tab_pane. The first tab pane must also have .in to make the initial content visible. Tab **/
def in:R = cls("in")
/** bootstrap info Tables contextual class to change row color" target="_blank" href="http://getbootstrap.com/css/#tables_contextual_classes Tables **/
def info:R = cls("info")
/** bootstrap jumbotron A content section that is used to showcase important content. Commonly used on home pages and category pages. Jumbotron **/
def jumbotron:R = cls("jumbotron")
/** bootstrap alert Applies default styling to labels "New" Labels **/
def label:R = cls("label")
/**_* bootstrap labels Change color of the label by adding one of the following: default, warning, info, danger, primary Labels **/
def labelDefault:R = cls("label-default")
def labelPrimary:R = cls("label-primary")
def labelSuccess:R = cls("label-success")
def labelInfo:R = cls("label-info")
def labelWarning:R = cls("label-warning")
def labelDanger:R = cls("label-danger")
/** bootstrap media list Media components are image heading and description text items. Blog comments, portfolio projects, album covers, etc. Media object **/
def media:R = cls("media")
/** bootstrap media body The class added for the media description copy block Media object **/
def mediaBody:R = cls("media-body")
/** bootstrap media heading The class applied to a heading in a media component Media object **/
def mediaHeading:R = cls("media-heading")
/** bootstrap Class added to a media component image Media object **/
def mediaObject:R = cls("media-object")
/** bootstrap nav nav base class added all types of navigation: tabs, pills, justified, disabled links Navs **/
def nav:R = cls("nav")
/** bootstrap Makes a tab navigation equal width and span the full width of its parent container Navs **/
def navJustified:R = cls("nav-justified")
/** bootstrap tabs Class added to enable Bootstrap tabs Tab **/
def navTabs:R = cls("nav-tabs")
/** bootstrap page header Used as a container for a page title and horizontal border for separation from the body content of a page Page header **/
def pageHeader:R = cls("page-header")
/** bootstrap pager class added to a ul which contains li's with anchors. Good for previous and next buttons Pagination **/
def pager:R = cls("pager")
/** bootstrap pagination The wrapper class that contains all of the page navigation Pagination **/
def pagination:R = cls("pagination")
/** bootstrap A popover is similar to a tooltip but activated on click Popover **/
def popover:R = cls("popover")
/** bootstrap A popover is similar to a tooltip but activated on click Popover **/
def popoverContent:R = cls("popover-content")
/** bootstrap A popover is similar to a tooltip but activated on click Popover **/
def popoverTitle:R = cls("popover-title")
/** bootstrap You may optionally add the .pre_scrollable class, which will set a max_height of 350px and provide a y_axis scrollbar. Code **/
def preScrollable:R = cls("pre-scrollable")
/** bootstrap progress bar The parent class wrapper of a progress bar Progress bars **/
def progress:R = cls("progress")
/** bootstrap progress bar The class applied to the progress bar graphic that moves Progress bars **/
def progressBar:R = cls("progress-bar")
/** bootstrap progress danger Changes color of progress bar to danger color Progress bars **/
def progressBarDanger:R = cls("progress-bar-danger")
/** bootstrap progress info Changes color of progress bar to info color Progress bars **/
def progressBarInfo:R = cls("progress-bar-info")
/** bootstrap progress bar striped Changes progress to a striped version Progress bars **/
def progressBarStriped:R = cls("progress-bar-striped")
/** bootstrap progress bar success Changes color of progress bar to success color Progress bars **/
def progressBarSuccess:R = cls("progress-bar-success")
/** bootstrap progress bar warning Changes color of progress bar to warning color Progress bars **/
def progressBarWarning:R = cls("progress-bar-warning")
/** bootstrap success Tables contextual class to change row color Tables **/
def success:R = cls("success")
/** bootstrap tab_pane Class added to the div that will act as a tab content area Tab **/
def tabPane:R = cls("tab-pane")
/** bootstrap table Adding this class to a HTML table applies the Bootstrap styles Tables **/
def table:R = cls("table")
/** bootstrap table condensed Removes some padding from the table cells Tables **/
def tableCondensed:R = cls("table-condensed")
/** bootstrap Adds borders to a table and its cells Tables **/
def tableBordered:R = cls("table-bordered")
/** bootstrap Makes a table responsive by cropping a wide table and makes it scrollable horizontally Tables **/
def tableResponsive:R = cls("table-responsive")
/** bootstrap thumbnail display grids of images, videos, text, and more. Thumbnails **/
def thumbnail:R = cls("thumbnail")
/** bootstrap This class is used by the tooltip javascript as the wrapper of the toolitp Tooltip **/
def tooltip:R = cls("tooltip")
/** bootstrap This is the arrow pointer on tooltips that can be positioned Tooltip **/
def tooltipArrow:R = cls("tooltip-arrow")
/** bootstrap The wrapper class of tooltip text. This is generated by the Bootstrap javascript **/
def tooltipInner:R = cls("tooltip-inner")
/** tooltip text! **/
def ome:R = cls("ome")
/** bootstrap Used on popovers and tooltips to show position of arrow Tooltip **/
def top:R = cls("top")
/**_*_* bootstrap Use a single or combination of the available classes for toggling content across viewport breakpoints. Responsive Utilities **/
def visible:R = cls("visible")
/** bootstrap Use a single or combination of the available classes for toggling content across viewport breakpoints. Responsive Utilities **/
def visiblePrintBlock:R = cls("visible-print-block")
/** bootstrap Use a single or combination of the available classes for toggling content across viewport breakpoints. Responsive Utilities **/
def visiblePrintInline:R = cls("visible-print-inline")
/** bootstrap Use a single or combination of the available classes for toggling content across viewport breakpoints. Responsive Utilities **/
def visiblePrintInlineBlock:R = cls("visible-print-inline-block")
/** bootstrap Tables contextual class to change row color Tables **/
def warning:R = cls("warning")
/** bootstrap well Wells are good for insetting some content. The default styling adds a border box and inner padding. Wells **/
def well:R = cls("well")
/** bootstrap well large Wells are good for insetting some content. The default styling adds a border box and inner padding. This class doubles the padding. Wells **/
def wellLg:R = cls("well-lg")
/** bootstrap well small Wells are good for insetting some content. The default styling adds a border box and inner padding. This class decreases the padding. Wells **/
def wellSm:R = cls("well-sm")
}
private[b3] trait Glyphicons [R] extends Any with Api[R] {
protected def cls(name:String):R
def glyphiconAsterisk:R = cls("glyphicon-asterisk")
def glyphiconPlus:R = cls("glyphicon-plus")
def glyphiconMinus:R = cls("glyphicon-minus")
def glyphiconEuro:R = cls("glyphicon-euro")
def glyphiconCloud:R = cls("glyphicon-cloud")
def glyphiconEnvelope:R = cls("glyphicon-envelope")
def glyphiconPencil:R = cls("glyphicon-pencil")
def glyphiconGlass:R = cls("glyphicon-glass")
def glyphiconMusic:R = cls("glyphicon-music")
def glyphiconSearch:R = cls("glyphicon-search")
def glyphiconHeart:R = cls("glyphicon-heart")
def glyphiconStar:R = cls("glyphicon-star")
def glyphiconStarEmpty:R = cls("glyphicon-star-empty")
def glyphiconUser:R = cls("glyphicon-user")
def glyphiconFilm:R = cls("glyphicon-film")
def glyphiconThLarge:R = cls("glyphicon-th-large")
def glyphiconTh:R = cls("glyphicon-th")
def glyphiconThList:R = cls("glyphicon-th-list")
def glyphiconOk:R = cls("glyphicon-ok")
def glyphiconRemove:R = cls("glyphicon-remove")
def glyphiconZoomIn:R = cls("glyphicon-zoom-in")
def glyphiconZoomOut:R = cls("glyphicon-zoom-out")
def glyphiconOff:R = cls("glyphicon-off")
def glyphiconSignal:R = cls("glyphicon-signal")
def glyphiconCog:R = cls("glyphicon-cog")
def glyphiconTrash:R = cls("glyphicon-trash")
def glyphiconHome:R = cls("glyphicon-home")
def glyphiconFile:R = cls("glyphicon-file")
def glyphiconTime:R = cls("glyphicon-time")
def glyphiconRoad:R = cls("glyphicon-road")
def glyphiconDownloadAlt:R = cls("glyphicon-download-alt")
def glyphiconDownload:R = cls("glyphicon-download")
def glyphiconUpload:R = cls("glyphicon-upload")
def glyphiconInbox:R = cls("glyphicon-inbox")
def glyphiconPlayCircle:R = cls("glyphicon-play-circle")
def glyphiconRepeat:R = cls("glyphicon-repeat")
def glyphiconRefresh:R = cls("glyphicon-refresh")
def glyphiconListAlt:R = cls("glyphicon-list-alt")
def glyphiconLock:R = cls("glyphicon-lock")
def glyphiconFlag:R = cls("glyphicon-flag")
def glyphiconHeadphones:R = cls("glyphicon-headphones")
def glyphiconVolumeOff:R = cls("glyphicon-volume-off")
def glyphiconVolumeDown:R = cls("glyphicon-volume-down")
def glyphiconVolumeUp:R = cls("glyphicon-volume-up")
def glyphiconQrcode:R = cls("glyphicon-qrcode")
def glyphiconBarcode:R = cls("glyphicon-barcode")
def glyphiconTag:R = cls("glyphicon-tag")
def glyphiconTags:R = cls("glyphicon-tags")
def glyphiconBook:R = cls("glyphicon-book")
def glyphiconBookmark:R = cls("glyphicon-bookmark")
def glyphiconPrint:R = cls("glyphicon-print")
def glyphiconCamera:R = cls("glyphicon-camera")
def glyphiconFont:R = cls("glyphicon-font")
def glyphiconBold:R = cls("glyphicon-bold")
def glyphiconItalic:R = cls("glyphicon-italic")
def glyphiconTextHeight:R = cls("glyphicon-text-height")
def glyphiconTextWidth:R = cls("glyphicon-text-width")
def glyphiconAlignLeft:R = cls("glyphicon-align-left")
def glyphiconAlignCenter:R = cls("glyphicon-align-center")
def glyphiconAlignRight:R = cls("glyphicon-align-right")
def glyphiconAlignJustify:R = cls("glyphicon-align-justify")
def glyphiconList:R = cls("glyphicon-list")
def glyphiconIndentLeft:R = cls("glyphicon-indent-left")
def glyphiconIndentRight:R = cls("glyphicon-indent-right")
def glyphiconFacetimeVideo:R = cls("glyphicon-facetime-video")
def glyphiconPicture:R = cls("glyphicon-picture")
def glyphiconMapMarker:R = cls("glyphicon-map-marker")
def glyphiconAdjust:R = cls("glyphicon-adjust")
def glyphiconTint:R = cls("glyphicon-tint")
def glyphiconEdit:R = cls("glyphicon-edit")
def glyphiconShare:R = cls("glyphicon-share")
def glyphiconCheck:R = cls("glyphicon-check")
def glyphiconMove:R = cls("glyphicon-move")
def glyphiconStepBackward:R = cls("glyphicon-step-backward")
def glyphiconFastBackward:R = cls("glyphicon-fast-backward")
def glyphiconBackward:R = cls("glyphicon-backward")
def glyphiconPlay:R = cls("glyphicon-play")
def glyphiconPause:R = cls("glyphicon-pause")
def glyphiconStop:R = cls("glyphicon-stop")
def glyphiconForward:R = cls("glyphicon-forward")
def glyphiconFastForward:R = cls("glyphicon-fast-forward")
def glyphiconStepForward:R = cls("glyphicon-step-forward")
def glyphiconEject:R = cls("glyphicon-eject")
def glyphiconChevronLeft:R = cls("glyphicon-chevron-left")
def glyphiconChevronRight:R = cls("glyphicon-chevron-right")
def glyphiconPlusSign:R = cls("glyphicon-plus-sign")
def glyphiconMinusSign:R = cls("glyphicon-minus-sign")
def glyphiconRemoveSign:R = cls("glyphicon-remove-sign")
def glyphiconOkSign:R = cls("glyphicon-ok-sign")
def glyphiconQuestionSign:R = cls("glyphicon-question-sign")
def glyphiconInfoSign:R = cls("glyphicon-info-sign")
def glyphiconScreenshot:R = cls("glyphicon-screenshot")
def glyphiconRemoveCircle:R = cls("glyphicon-remove-circle")
def glyphiconOkCircle:R = cls("glyphicon-ok-circle")
def glyphiconBanCircle:R = cls("glyphicon-ban-circle")
def glyphiconArrowLeft:R = cls("glyphicon-arrow-left")
def glyphiconArrowRight:R = cls("glyphicon-arrow-right")
def glyphiconArrowUp:R = cls("glyphicon-arrow-up")
def glyphiconArrowDown:R = cls("glyphicon-arrow-down")
def glyphiconShareAlt:R = cls("glyphicon-share-alt")
def glyphiconResizeFull:R = cls("glyphicon-resize-full")
def glyphiconResizeSmall:R = cls("glyphicon-resize-small")
def glyphiconExclamationSign:R = cls("glyphicon-exclamation-sign")
def glyphiconGift:R = cls("glyphicon-gift")
def glyphiconLeaf:R = cls("glyphicon-leaf")
def glyphiconFire:R = cls("glyphicon-fire")
def glyphiconEyeOpen:R = cls("glyphicon-eye-open")
def glyphiconEyeClose:R = cls("glyphicon-eye-close")
def glyphiconWarningSign:R = cls("glyphicon-warning-sign")
def glyphiconPlane:R = cls("glyphicon-plane")
def glyphiconCalendar:R = cls("glyphicon-calendar")
def glyphiconRandom:R = cls("glyphicon-random")
def glyphiconComment:R = cls("glyphicon-comment")
def glyphiconMagnet:R = cls("glyphicon-magnet")
def glyphiconChevronUp:R = cls("glyphicon-chevron-up")
def glyphiconChevronDown:R = cls("glyphicon-chevron-down")
def glyphiconRetweet:R = cls("glyphicon-retweet")
def glyphiconShoppingCart:R = cls("glyphicon-shopping-cart")
def glyphiconFolderClose:R = cls("glyphicon-folder-close")
def glyphiconFolderOpen:R = cls("glyphicon-folder-open")
def glyphiconResizeVertical:R = cls("glyphicon-resize-vertical")
def glyphiconResizeHorizontal:R = cls("glyphicon-resize-horizontal")
def glyphiconHdd:R = cls("glyphicon-hdd")
def glyphiconBullhorn:R = cls("glyphicon-bullhorn")
def glyphiconBell:R = cls("glyphicon-bell")
def glyphiconCertificate:R = cls("glyphicon-certificate")
def glyphiconThumbsUp:R = cls("glyphicon-thumbs-up")
def glyphiconThumbsDown:R = cls("glyphicon-thumbs-down")
def glyphiconHandRight:R = cls("glyphicon-hand-right")
def glyphiconHandLeft:R = cls("glyphicon-hand-left")
def glyphiconHandUp:R = cls("glyphicon-hand-up")
def glyphiconHandDown:R = cls("glyphicon-hand-down")
def glyphiconCircleArrowRight:R = cls("glyphicon-circle-arrow-right")
def glyphiconCircleArrowLeft:R = cls("glyphicon-circle-arrow-left")
def glyphiconCircleArrowUp:R = cls("glyphicon-circle-arrow-up")
def glyphiconCircleArrowDown:R = cls("glyphicon-circle-arrow-down")
def glyphiconGlobe:R = cls("glyphicon-globe")
def glyphiconWrench:R = cls("glyphicon-wrench")
def glyphiconTasks:R = cls("glyphicon-tasks")
def glyphiconFilter:R = cls("glyphicon-filter")
def glyphiconBriefcase:R = cls("glyphicon-briefcase")
def glyphiconFullscreen:R = cls("glyphicon-fullscreen")
def glyphiconDashboard:R = cls("glyphicon-dashboard")
def glyphiconPaperclip:R = cls("glyphicon-paperclip")
def glyphiconHeartEmpty:R = cls("glyphicon-heart-empty")
def glyphiconLink:R = cls("glyphicon-link")
def glyphiconPhone:R = cls("glyphicon-phone")
def glyphiconPushpin:R = cls("glyphicon-pushpin")
def glyphiconUsd:R = cls("glyphicon-usd")
def glyphiconGbp:R = cls("glyphicon-gbp")
def glyphiconSort:R = cls("glyphicon-sort")
def glyphiconSortByAlphabet:R = cls("glyphicon-sort-by-alphabet")
def glyphiconSortByAlphabetAlt:R = cls("glyphicon-sort-by-alphabet-alt")
def glyphiconSortByOrder:R = cls("glyphicon-sort-by-order")
def glyphiconSortByOrderAlt:R = cls("glyphicon-sort-by-order-alt")
def glyphiconSortByAttributes:R = cls("glyphicon-sort-by-attributes")
def glyphiconSortByAttributesAlt:R = cls("glyphicon-sort-by-attributes-alt")
def glyphiconUnchecked:R = cls("glyphicon-unchecked")
def glyphiconExpand:R = cls("glyphicon-expand")
def glyphiconCollapseDown:R = cls("glyphicon-collapse-down")
def glyphiconCollapseUp:R = cls("glyphicon-collapse-up")
def glyphiconLogIn:R = cls("glyphicon-log-in")
def glyphiconFlash:R = cls("glyphicon-flash")
def glyphiconLogOut:R = cls("glyphicon-log-out")
def glyphiconNewWindow:R = cls("glyphicon-new-window")
def glyphiconRecord:R = cls("glyphicon-record")
def glyphiconSave:R = cls("glyphicon-save")
def glyphiconOpen:R = cls("glyphicon-open")
def glyphiconSaved:R = cls("glyphicon-saved")
def glyphiconImport:R = cls("glyphicon-import")
def glyphiconExport:R = cls("glyphicon-export")
def glyphiconSend:R = cls("glyphicon-send")
def glyphiconFloppyDisk:R = cls("glyphicon-floppy-disk")
def glyphiconFloppySaved:R = cls("glyphicon-floppy-saved")
def glyphiconFloppyRemove:R = cls("glyphicon-floppy-remove")
def glyphiconFloppySave:R = cls("glyphicon-floppy-save")
def glyphiconFloppyOpen:R = cls("glyphicon-floppy-open")
def glyphiconCreditCard:R = cls("glyphicon-credit-card")
def glyphiconTransfer:R = cls("glyphicon-transfer")
def glyphiconCutlery:R = cls("glyphicon-cutlery")
def glyphiconHeader:R = cls("glyphicon-header")
def glyphiconCompressed:R = cls("glyphicon-compressed")
def glyphiconEarphone:R = cls("glyphicon-earphone")
def glyphiconPhoneAlt:R = cls("glyphicon-phone-alt")
def glyphiconTower:R = cls("glyphicon-tower")
def glyphiconStats:R = cls("glyphicon-stats")
def glyphiconSdVideo:R = cls("glyphicon-sd-video")
def glyphiconHdVideo:R = cls("glyphicon-hd-video")
def glyphiconSubtitles:R = cls("glyphicon-subtitles")
def glyphiconSoundStereo:R = cls("glyphicon-sound-stereo")
def glyphiconSoundDolby:R = cls("glyphicon-sound-dolby")
def glyphiconSound51:R = cls("glyphicon-sound-5-1")
def glyphiconSound61:R = cls("glyphicon-sound-6-1")
def glyphiconSound71:R = cls("glyphicon-sound-7-1")
def glyphiconCopyrightMark:R = cls("glyphicon-copyright-mark")
def glyphiconRegistrationMark:R = cls("glyphicon-registration-mark")
def glyphiconCloudDownload:R = cls("glyphicon-cloud-download")
def glyphiconCloudUpload:R = cls("glyphicon-cloud-upload")
def glyphiconTreeConifer:R = cls("glyphicon-tree-conifer")
def glyphiconTreeDeciduous:R = cls("glyphicon-tree-deciduous")
def glyphiconCd:R = cls("glyphicon-cd")
def glyphiconSaveFile:R = cls("glyphicon-save-file")
def glyphiconOpenFile:R = cls("glyphicon-open-file")
def glyphiconLevelUp:R = cls("glyphicon-level-up")
def glyphiconCopy:R = cls("glyphicon-copy")
def glyphiconPaste:R = cls("glyphicon-paste")
def glyphiconAlert:R = cls("glyphicon-alert")
def glyphiconEqualizer:R = cls("glyphicon-equalizer")
def glyphiconKing:R = cls("glyphicon-king")
def glyphiconQueen:R = cls("glyphicon-queen")
def glyphiconPawn:R = cls("glyphicon-pawn")
def glyphiconBishop:R = cls("glyphicon-bishop")
def glyphiconKnight:R = cls("glyphicon-knight")
def glyphiconBabyFormula:R = cls("glyphicon-baby-formula")
def glyphiconTent:R = cls("glyphicon-tent")
def glyphiconBlackboard:R = cls("glyphicon-blackboard")
def glyphiconBed:R = cls("glyphicon-bed")
def glyphiconApple:R = cls("glyphicon-apple")
def glyphiconErase:R = cls("glyphicon-erase")
def glyphiconHourglass:R = cls("glyphicon-hourglass")
def glyphiconLamp:R = cls("glyphicon-lamp")
def glyphiconDuplicate:R = cls("glyphicon-duplicate")
def glyphiconPiggyBank:R = cls("glyphicon-piggy-bank")
def glyphiconScissors:R = cls("glyphicon-scissors")
def glyphiconBitcoin:R = cls("glyphicon-bitcoin")
def glyphiconYen:R = cls("glyphicon-yen")
def glyphiconRuble:R = cls("glyphicon-ruble")
def glyphiconScale:R = cls("glyphicon-scale")
def glyphiconIceLolly:R = cls("glyphicon-ice-lolly")
def glyphiconIceLollyTasted:R = cls("glyphicon-ice-lolly-tasted")
def glyphiconEducation:R = cls("glyphicon-education")
def glyphiconOptionHorizontal:R = cls("glyphicon-option-horizontal")
def glyphiconOptionVertical:R = cls("glyphicon-option-vertical")
def glyphiconMenuHamburger:R = cls("glyphicon-menu-hamburger")
def glyphiconModalWindow:R = cls("glyphicon-modal-window")
def glyphiconOil:R = cls("glyphicon-oil")
def glyphiconGrain:R = cls("glyphicon-grain")
def glyphiconSunglasses:R = cls("glyphicon-sunglasses")
def glyphiconTextSize:R = cls("glyphicon-text-size")
def glyphiconTextColor:R = cls("glyphicon-text-color")
def glyphiconTextBackground:R = cls("glyphicon-text-background")
def glyphiconObjectAlignTop:R = cls("glyphicon-object-align-top")
def glyphiconObjectAlignBottom:R = cls("glyphicon-object-align-bottom")
def glyphiconObjectAlignHorizontal:R = cls("glyphicon-object-align-horizontal")
def glyphiconObjectAlignLeft:R = cls("glyphicon-object-align-left")
def glyphiconObjectAlignVertical:R = cls("glyphicon-object-align-vertical")
def glyphiconObjectAlignRight:R = cls("glyphicon-object-align-right")
def glyphiconTriangleRight:R = cls("glyphicon-triangle-right")
def glyphiconTriangleLeft:R = cls("glyphicon-triangle-left")
def glyphiconTriangleBottom:R = cls("glyphicon-triangle-bottom")
def glyphiconTriangleTop:R = cls("glyphicon-triangle-top")
def glyphiconSuperscript:R = cls("glyphicon-superscript")
def glyphiconSubscript:R = cls("glyphicon-subscript")
def glyphiconMenuLeft:R = cls("glyphicon-menu-left")
def glyphiconMenuRight:R = cls("glyphicon-menu-right")
def glyphiconMenuDown:R = cls("glyphicon-menu-down")
def glyphiconMenuUp:R = cls("glyphicon-menu-up")
}
@scalway
Copy link
Author

scalway commented Jun 2, 2017

This is helper library for Bootstrap3. It brings all bootstrap html classes into your scalatags views.

basic usage:

//we'll build on top of scalatags elements 
import scalatags.JsDom.all._
//import almost all bootstrap3 classes (glyphicons needs to be imported separetly)
import jsutils.b3.JsDom.all._
//div is normal scalatags div object
//.btn is method added by implicit conversion. It adds 'btn' class to our div
//.btnLg will add class 'btn-lg' and so on.
//each function'll keep type of element. In our case it'll be TypedTag[Div] 
val closeBtn:Div = div.btn.btnLg.btnSuccess.textNowrap("Save", data.dismiss:="modal").render

imports with limited scope:

import scalatags.JsDom.all._
//limit scope to button classes only
import jsutils.b3.JsDom.buttons._
//additional import that allows us to use class names without prefix div.
import jsutils.b3.JsDom.short.div._
//                              ^ give you divs implicitly 
val closeBtn:Div = btnLg.btnSuccess("Save").render

there is more:

import jsutils.b3.JsDom.helpers._
import jsutils.b3.JsDom.navbars._
import jsutils.b3.JsDom.buttons._
import jsutils.b3.JsDom.gridSystem._
import jsutils.b3.JsDom.modals._
import jsutils.b3.JsDom.forms._
import jsutils.b3.JsDom.typography._
import jsutils.b3.JsDom.panels._
import jsutils.b3.JsDom.listGroup._
import jsutils.b3.JsDom.dropdowns._
import jsutils.b3.JsDom.carousel._
import jsutils.b3.JsDom.other._
import jsutils.b3.JsDom.glyphicon._

grid system:

//import short notation for gridSystem only with div as base element
 import jsutils.b3.JsDom.gridSystem.short.div._
//we still need it to chain classes
import jsutils.b3.JsDom.gridSystem._
//and use it :)
  containerFluid( row(
    colMd(5)("test"),
    colMd(5).colMdOffset(2)("test")
  ))

glyphicon:

import jsutils.b3.JsDom.button.short.button._
//even if you have imported '.short.button._'  you stil need this import to chain classes
import jsutils.b3.JsDom.button._
//glyphicons is not imported in jsutils.b3.Bootstrap3.all._
import jsutils.b3.JsDom.glyphicons.short.i._

btn.btnLg( glyphiconApple(paddingRight := "22px"), "Apple button")
//<div class="btn btn-lg"><i class="glyphicon glyphicon-apple" style="padding-right:22px"></i>Apple buton</div>

additional .cls(str) method:
in scalatags by default we can only override attr.
Whenever you'll use cls:="sth" all previous classes'll be lost :(.
This means we should give you additional way of appending class

import jsutils.b3.JsDom.button.short.button._
//this additional method'll be imported from all or (if you prefer limited scope imports) directly from JsDom or Text accessor. 
//import jsutils.b3.JsDom.appendCls
import jsutils.b3.JsDom.all._

btn.cls("my-weird-btn").btnLg("Apple button")

all implicit conversions uses only AnyVal classes.

TODO--

  • current architecture disallow to have same class in few groups (active, disabled)
  • don't know if short is good name for 'fast' accessors.
  • maybe automatic of code generator 4 less/sass files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment