Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Feature/stij 129: Make inline buttons the default #111

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,59 @@
# Changelog
All Notable changes to `digipolisgent/fractal_styleguide_gent-base`.

## 2.6.9
## 2.7.0 IMPORTANT
**This change may break the way your buttons work!**

* STIJ-129: **IMPORTANT!**: Changed button classes to be consistent with their SASS placeholders!
* STIJ-129: Changed implementation of button. All buttons are now `inline` by default!
* STIJ-129: Updated button documentation.
* STIJ-131: Remove placeholders from all input type fields except search fields.
* STIJ-63: Made Fractal variants of paragraphs.
* STIJ-63: Remove underlined text from paragraph examples,
it is discouraged to use underlined text.
* STIJ-131: Remove placeholders from all input type fields except search fields.

***

## 2.6.8
* STIJ-25: Added themify to the status messages component.

***

## 2.6.7
* Fixed select box appearance in IE.
* STIJ-139: Added no-optional class to hide optional from field labels.
* STIJ-139: Changed the styling of checkbox and radio field labels.
* STIJ-139: Added fieldset styling.
* STIJ-139: Changed class of messages.

***

## 2.6.6
* Fixed a bug in the postinstall.sh script.

***

## 2.6.5
* STIJ-126: Removed CDN imports of external libraries and added them through yarn.

***

## 2.6.4
* STIJ-125: Fixed close button for items inside multiselect.
* STIJ-137: Changed preview template for Mijn Gent block.

***

## 2.6.3
* STIJ-40: Fixed ugly styling on buttons and input fields for iOS.

***

## 2.6.2
* STIJ-35: Added bindings and functions for the Gallery component.

***

## 2.6.1
* STIJ-2:
* Added default no-style styling to lists in the hamburger menu.
Expand Down
2 changes: 1 addition & 1 deletion components/11-base/section/section.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% include '@h6' with { 'h6_text': 'Heading 6' } %}
{% include '@paragraph' with { 'text': 'Normal text below an heading 6.'} %}
{% include '@paragraph' with { 'text': 'Paragraphs <a href="#">link</a>'} %}
<p>{% include '@button-sm' with { 'text': 'Button'} %}</p>
<p>{% include '@button' with { 'text': 'Button'} %}</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be better to use the same names for placeholders and the corresponding buttons in Sass

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this. What do you think?

<p>{% include '@button-md' with { 'text': 'Button'} %}</p>
<p>{% include '@button-lg' with { 'text': 'Button'} %}</p>
{% include '@button-drop' %}
Expand Down
31 changes: 31 additions & 0 deletions components/21-atoms/button/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Buttons
There are 3 types of buttons defined:
* Small
* Medium (default)
* Large

By default buttons are always inline!
That means when you want to create a full width button you will need to use the `btn-block` mixin we provide.

We provide the some classes to add to elements that need to be styled like buttons:
We also provide a SASS placeholder.

## Small buttons
* `%btn--small`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we implement two different button classes? This is a bit confusing. Placeholder for extends is ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is meant to be backwards compatible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jeroen005 can you check if these button classes are still necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classy is using .button if I'm not mistaking.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. If that is the case we should leave it in for now untill we have time to refactor the basetheme to strip the classy classes and add the styleguide markup

* `.small.btn`
* `.btn--small`

## Medium buttons
* `%btn--medium`
* `.medium.btn`
* `.btn--medium`

## Large buttons
* `%btn--large`
* `.large.btn`
* `.btn--large`

Furthermore to improve semantic HTML we provide SASS mixins to create these buttons.
* `@mixin btn-s;` for small buttons.
* `@mixin btn-m;` for medium buttons (default).
* `@mixin btn-l;` for large buttons.
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
//
// Button size mixins.
//
@mixin btn-l {
@mixin btn-large {
padding-top: .7rem;
padding-bottom: .7rem;
font-size: 1rem;
line-height: 1.5rem;
}
@mixin btn-m {
@mixin btn-medium {
padding-top: .45rem;
padding-bottom: .45rem;
font-size: 1rem;
line-height: 1.5rem;
}
@mixin btn-s {
@mixin btn-small {
padding-top: .2rem;
padding-bottom: .2rem;
font-size: .8rem;
line-height: 1.4rem;
}

//
// Button display
// Button inline display (default).
//
@mixin btn-inlineblock {
display: inline-block;
width: auto;
}

//
// General button styling.
// Button block display.
//
@mixin btn-block {
display: block;
}

//
// General button styling (default).
//
%btn,
.btn,
Expand All @@ -42,10 +48,9 @@ input[type='submit'] {
@include color-element-states($button-background, $button-background-hover, $property: "background");
@include color-element-states($button-border, $button-border-hover, $property: "border");
}
@include btn-m;
display: block;
@include btn-medium;
@include btn-inlineblock;
position: relative;
width: 100%;
margin: 0;
padding-right: 1rem;
padding-left: 1rem;
Expand Down Expand Up @@ -85,15 +90,29 @@ input[type='submit'] {
}
}

//
// Inline button styling.
//
%btn--inline,
.inline.btn,
.btn--inline,
a.btn--inline,
button.btn--inline,
input[type='button'].btn--inline,
input[type='submit'].btn--inline {
@include btn-inlineblock
%btn--small,
.btn--small,
a.btn--small,
button.btn--small,
input[type="button"].btn--small,
input[type='submit'].btn--small {
@include btn-small;
}

%btn--medium,
.btn--medium,
a.btn--medium,
button.btn--medium,
input[type='button'].btn--medium,
input[type='submit'].btn--medium {
@include btn-medium;
}

%btn--large,
.btn--large,
a.btn--large,
button.btn--large,
input[type="button"].btn--large,
input[type='submit'].btn--large {
@include btn-large;
}
33 changes: 33 additions & 0 deletions components/21-atoms/button/button.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"title": "Button",
"name": "Button",
"status": "ready",
"default": "button-sm",
"order": 1,
"context": {
"text": "Button"
},
"variants": [
{
"name": "button-sm",
"handle": "button",
"context": {
"modifier": "btn--small"
}
},
{
"name": "button-md",
"handle": "md",
"context": {
"modifier": "btn--medium"
}
},
{
"name": "button-lg",
"handle": "button-lg",
"context": {
"modifier": "btn--large"
}
}
]
}
1 change: 1 addition & 0 deletions components/21-atoms/button/button.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<input type="button" class="btn {{ modifier }}" value="{{ text }}">
9 changes: 0 additions & 9 deletions components/21-atoms/buttons/button-lg/_button-lg.scss

This file was deleted.

18 changes: 0 additions & 18 deletions components/21-atoms/buttons/button-lg/button-lg.config.json

This file was deleted.

1 change: 0 additions & 1 deletion components/21-atoms/buttons/button-lg/button-lg.twig

This file was deleted.

9 changes: 0 additions & 9 deletions components/21-atoms/buttons/button-md/_button-md.scss

This file was deleted.

18 changes: 0 additions & 18 deletions components/21-atoms/buttons/button-md/button-md.config.json

This file was deleted.

1 change: 0 additions & 1 deletion components/21-atoms/buttons/button-md/button-md.twig

This file was deleted.

9 changes: 0 additions & 9 deletions components/21-atoms/buttons/button-sm/_button-sm.scss

This file was deleted.

18 changes: 0 additions & 18 deletions components/21-atoms/buttons/button-sm/button-sm.config.json

This file was deleted.

1 change: 0 additions & 1 deletion components/21-atoms/buttons/button-sm/button-sm.twig

This file was deleted.

5 changes: 0 additions & 5 deletions components/21-atoms/buttons/buttons.config.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

.chosen-container-multi .chosen-choices li.search-choice {
@extend %btn;
@include btn-s;
@include btn-small;

.search-choice-close {
right: 1.2rem;
Expand Down
4 changes: 2 additions & 2 deletions components/51-templates/buttons/buttons.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Buttons",
"status": "ready",
"handle": "buttons",
"preview": "@preview",
"handle": "buttons-overview",
"preview": "@preview-buttons",
"order": 3,
"context": {
"text": "Button"
Expand Down
Loading