////////////////////////////////////////////////////////////////////////////////
//
//  Licensed to the Apache Software Foundation (ASF) under one or more
//  contributor license agreements.  See the NOTICE file distributed with
//  this work for additional information regarding copyright ownership.
//  The ASF licenses this file to You under the Apache License, Version 2.0
//  (the "License"); you may not use this file except in compliance with
//  the License.  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////

// Jewel ToggleButton

// ToggleButton variables
$togglebutton-border-radius: $border-radius

=togglebutton-theme($togglebutton-color, $text-color)
	
	+jewel-bg-border("normal", $togglebutton-color, $togglebutton-border-radius)
	
	color: $text-color
		
	@if not $flat and $text-color == $font-theme-color
		text:
			shadow: 0 -1px 0 rgba(darken($togglebutton-color, 30%), .7)
	
	&:hover, &:hover:focus
		+jewel-bg-border("hover", $togglebutton-color)

	&:active, &:active:focus
		+jewel-bg-border("active", $togglebutton-color)

	&:focus
		+jewel-bg-border("focus", $togglebutton-color)
		
	&[disabled]
		+jewel-bg-border("disabled", $togglebutton-color)
		color: $disabled-font-color
		text:
			shadow: unset
	
	&.selected
		+jewel-bg-border("selected", $togglebutton-color)

.jewel.togglebutton
	+togglebutton-theme($default-color, $default-font-color)


	// -- TOGGLEBUTTON LABEL
	font:
		// family: $font-stack 
		weight: bold
	text:
		transform: uppercase

	@if $transitions-enable
		transition:
			duration: $transition-duration
			timing-function: $transition-timing

	&[disabled]
		font:
			weight: $font-weight-normal
	
	&.icon
		i
			margin-left: 0px
			margin-right: 0px

	&.iconLSpace
		i
			margin-left: 0px
			margin-right: 8px
	&.iconRSpace
		i
			margin-left: 8px
			margin-right: 0px

.jewel.togglebutton.primary
	+togglebutton-theme($primary-color, $font-theme-color)

