Skip to content

Commit

Permalink
[FEATURE] add theme variables for button styles (#362)
Browse files Browse the repository at this point in the history
Different button styles depending on default colors
* btn-default
* btn-default--inverted
* btn-bordered
* btn-bordered--inverted
  • Loading branch information
Anna Färber authored and MattiasNilsson committed Dec 7, 2017
1 parent 1697082 commit 1c7ba14
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 4 deletions.
12 changes: 12 additions & 0 deletions Configuration/TypoScript/Library/plugin.dyncss.setupts
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,16 @@ plugin.tx_dyncss.overrides {
if.isTrue = {$themes.configuration.less.var.footerLinkHoverColor}
}

# BUTTONS
btn-default-color = TEXT
btn-default-color {
value = {$themes.configuration.less.var.buttonTextColor}
if.isTrue = {$themes.configuration.less.var.buttonTextColor}
}

btn-default-bg = TEXT
btn-default-bg {
value = {$themes.configuration.less.var.buttonBgColor}
if.isTrue = {$themes.configuration.less.var.buttonBgColor}
}
}
8 changes: 8 additions & 0 deletions Configuration/TypoScript/Library/themes.less.constantsts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ themes.configuration.less.var.mainLinkColor =
themes.configuration.less.var.mainLinkHoverColor =


# Buttons
#############################################
# customsubcategory=button_colors=Button Colors
# cat=colors,basic/button_colors/; type=color; label= Button Text Color
themes.configuration.less.var.buttonTextColor =
# cat=colors,basic/button_colors/; type=color; label= Button Background Color
themes.configuration.less.var.buttonBgColor =



#############################################
Expand Down
7 changes: 3 additions & 4 deletions felayout_t3kit/dev/styles/customVariables.less
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,11 @@
//== Buttons BOOTSTRAP
//
//## For each of Bootstrap's buttons, define text, background and border color.

@btn-font-weight: normal;
@btn-default-color: @main-color;
@btn-default-bg: transparent;
@btn-default-border: tint(@main-color, 70%);
@btn-border-radius-base: none;
@btn-default-color: @main-body-bg;
@btn-default-bg: @main-color;
@btn-default-border: @main-color;

@padding-base-vertical: 8px;
@padding-base-horizontal: 14px;
Expand Down
20 changes: 20 additions & 0 deletions felayout_t3kit/dev/styles/main/general.less
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,25 @@ h1,
h2 {
font-family: @font-family-serif;
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

// ============================
// ======== Button styles ====
// ============================
.btn-default {
.btn-style--t3kit(@btn-default-color, @btn-default-bg, transparent);
}

.btn-default--inverted {
.btn-style--t3kit(@btn-default-bg, @btn-default-color, transparent);
}

.btn-bordered {
.btn-style--t3kit(@btn-default-bg, transparent, @btn-default-bg);
}

.btn-bordered--inverted {
.btn-style--t3kit(@btn-default-color, transparent, @btn-default-color);
}
16 changes: 16 additions & 0 deletions felayout_t3kit/dev/styles/main/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,19 @@
opacity: 0.6;
}
}

// =================================
// === Set style for buttons =======
// =================================
.btn-style--t3kit(@color; @background; @border) {
color: @color;
background-color: @background;
border-color: @border;

&:focus,
&:hover {
color: @color;
background-color: darken(@background, 10%);
border-color: darken(@border, 10%);
}
}

0 comments on commit 1c7ba14

Please sign in to comment.