Skip to content

Commit

Permalink
✨ feat(button.css): Better styling for button groups in smaller screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiderpig86 committed Mar 12, 2020
1 parent 062a109 commit 43e8499
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 61 deletions.
51 changes: 34 additions & 17 deletions dist/cirrus-core.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Cirrus 0.5.5
* Stanley Lim, Copyright 2019
* Cirrus 0.5.6
* Stanley Lim, Copyright 2020
* https://spiderpig86.github.io/Cirrus
*/
/* BUTTONS */
Expand Down Expand Up @@ -332,21 +332,6 @@ button span:last-child,
[type="submit"] span:last-child {
margin-left: 0.2rem;
}
/* Deprecated 0.5.5
/* Button with accent
.btn-accent {
background-color: var(--cirrus-primary);
color: #fff;
border-color: var(--cirrus-accent-border);
}
.btn-accent:hover {
background-color: var(--cirrus-accent-hover);
}
.btn-accent:active {
background-color: var(--cirrus-accent-border);
} */

/* BUTTON GROUPS */
/* Will group buttons with components in a single component */
Expand Down Expand Up @@ -408,6 +393,38 @@ button span:last-child,
border-radius: 0; /* Remove roundness from center buttons */
margin-left: -0.1rem;
}

@media screen and (max-width: 768px) {
.btn-group {
display: flex;
flex-direction: column;
}

.btn-group .btn,
.btn-group button,
.btn-group [type="submit"] {
margin-bottom: -1px;
}

.btn-group .btn:first-child:not(:last-child),
.btn-group button:first-child:not(:last-child),
.btn-group [type="submit"]:first-child:not(:last-child) {
border-radius: .25rem .25rem 0 0;
}

.btn-group .btn:last-child:not(:first-child),
.btn-group button:last-child:not(:first-child),
.btn-group [type="submit"]:last-child:not(:first-child) {
margin: 0;
}

.btn-group .btn:not(:first-child):not(:last-child),
.btn-group button:not(:first-child):not(:last-child),
.btn-group [type="submit"]:not(:first-child):not(:last-child) {
border-radius: 0 0 .25rem .25rem ;
margin: 0;
}
}
/* CODE */

code {
Expand Down
6 changes: 3 additions & 3 deletions dist/cirrus-core.min.css

Large diffs are not rendered by default.

51 changes: 34 additions & 17 deletions dist/cirrus.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Cirrus 0.5.5
* Stanley Lim, Copyright 2019
* Cirrus 0.5.6
* Stanley Lim, Copyright 2020
* https://spiderpig86.github.io/Cirrus
*/
/* BUTTONS */
Expand Down Expand Up @@ -332,21 +332,6 @@ button span:last-child,
[type="submit"] span:last-child {
margin-left: 0.2rem;
}
/* Deprecated 0.5.5
/* Button with accent
.btn-accent {
background-color: var(--cirrus-primary);
color: #fff;
border-color: var(--cirrus-accent-border);
}
.btn-accent:hover {
background-color: var(--cirrus-accent-hover);
}
.btn-accent:active {
background-color: var(--cirrus-accent-border);
} */

/* BUTTON GROUPS */
/* Will group buttons with components in a single component */
Expand Down Expand Up @@ -407,6 +392,38 @@ button span:last-child,
/* Style button in middle of group */
border-radius: 0; /* Remove roundness from center buttons */
margin-left: -0.1rem;
}

@media screen and (max-width: 768px) {
.btn-group {
display: flex;
flex-direction: column;
}

.btn-group .btn,
.btn-group button,
.btn-group [type="submit"] {
margin-bottom: -1px;
}

.btn-group .btn:first-child:not(:last-child),
.btn-group button:first-child:not(:last-child),
.btn-group [type="submit"]:first-child:not(:last-child) {
border-radius: .25rem .25rem 0 0;
}

.btn-group .btn:last-child:not(:first-child),
.btn-group button:last-child:not(:first-child),
.btn-group [type="submit"]:last-child:not(:first-child) {
margin: 0;
}

.btn-group .btn:not(:first-child):not(:last-child),
.btn-group button:not(:first-child):not(:last-child),
.btn-group [type="submit"]:not(:first-child):not(:last-child) {
border-radius: 0 0 .25rem .25rem ;
margin: 0;
}
}
/* CODE */

Expand Down
6 changes: 3 additions & 3 deletions dist/cirrus.min.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var gulp = require('gulp');
var prop = require('./package.json');
var minify = require('gulp-clean-css');
var $ = require('gulp-load-plugins')();
var head = '\/*\r\n* Cirrus ' + prop.version + `\r\n* Stanley Lim, Copyright ${(new Date()).getFullYear()}\r\n* https://spiderpig86.github.io/Cirrus\r\n*/\r\n`;
const gulp = require('gulp');
const prop = require('./package.json');
const minify = require('gulp-clean-css');
const $ = require('gulp-load-plugins')();
const head = '\/*\r\n* Cirrus ' + prop.version + `\r\n* Stanley Lim, Copyright ${(new Date()).getFullYear()}\r\n* https://spiderpig86.github.io/Cirrus\r\n*/\r\n`;

gulp.task('compile', () => {
return gulp.src('./src/**/*.css')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cirrus-ui",
"version": "0.5.5",
"version": "0.5.6",
"description": "A lightweight UI framework written in CSS",
"main": "./dist/cirrus.min.css",
"filename": "cirrus.min.css",
Expand Down
47 changes: 32 additions & 15 deletions src/core/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,21 +327,6 @@ button span:last-child,
[type="submit"] span:last-child {
margin-left: 0.2rem;
}
/* Deprecated 0.5.5
/* Button with accent
.btn-accent {
background-color: var(--cirrus-primary);
color: #fff;
border-color: var(--cirrus-accent-border);
}
.btn-accent:hover {
background-color: var(--cirrus-accent-hover);
}
.btn-accent:active {
background-color: var(--cirrus-accent-border);
} */

/* BUTTON GROUPS */
/* Will group buttons with components in a single component */
Expand Down Expand Up @@ -402,4 +387,36 @@ button span:last-child,
/* Style button in middle of group */
border-radius: 0; /* Remove roundness from center buttons */
margin-left: -0.1rem;
}

@media screen and (max-width: 768px) {
.btn-group {
display: flex;
flex-direction: column;
}

.btn-group .btn,
.btn-group button,
.btn-group [type="submit"] {
margin-bottom: -1px;
}

.btn-group .btn:first-child:not(:last-child),
.btn-group button:first-child:not(:last-child),
.btn-group [type="submit"]:first-child:not(:last-child) {
border-radius: .25rem .25rem 0 0;
}

.btn-group .btn:last-child:not(:first-child),
.btn-group button:last-child:not(:first-child),
.btn-group [type="submit"]:last-child:not(:first-child) {
margin: 0;
}

.btn-group .btn:not(:first-child):not(:last-child),
.btn-group button:not(:first-child):not(:last-child),
.btn-group [type="submit"]:not(:first-child):not(:last-child) {
border-radius: 0 0 .25rem .25rem ;
margin: 0;
}
}

0 comments on commit 43e8499

Please sign in to comment.