1
0
mirror of https://github.com/jenil/chota.git synced 2023-08-10 21:13:07 +03:00

Merge pull request #40 from yne/master

Add `.grouped.gapless` class
This commit is contained in:
Jenil Gogari 2019-09-15 13:26:44 -04:00 committed by GitHub
commit ee19848081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 16 deletions

19
dist/chota.css vendored
View File

@ -524,17 +524,23 @@ button {
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
} }
.grouped > input:not(:last-child), .grouped > *:not(:last-child) {
.grouped > select:not(:last-child),
.grouped > .button:not(:last-child) {
margin-right: 16px; margin-right: 16px;
} }
.grouped.gapless > * {
margin: 0 0 0 -1px !important;
border-radius:0 !important;
}
.grouped.gapless > *:first-child {
margin: 0 !important;
border-radius:4px 0 0 4px !important;
}
.grouped.gapless > *:last-child {
border-radius:0 4px 4px 0 !important;
}
.button + .button { .button + .button {
margin-left: 1rem; margin-left: 1rem;
} }
.buttons > .button + .button {
margin-left: 0;
}
.button:hover, .button:hover,
[type="button"]:hover, [type="button"]:hover,
[type="reset"]:hover, [type="reset"]:hover,
@ -564,6 +570,7 @@ button:disabled:hover {
.button.success, .button.success,
[type="submit"] { [type="submit"] {
color: #fff; color: #fff;
z-index: 1; /* hightlight from other button's border when grouped */
background-color: #000; background-color: #000;
background-color: var(--color-primary); background-color: var(--color-primary);
} }

2
dist/chota.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -87,12 +87,34 @@
<li><code>hide-pr</code> - hides the element for printing</li> <li><code>hide-pr</code> - hides the element for printing</li>
</ul> </ul>
<h4>Details</h4> <h4>Details</h4>
<p>You can have a <code>&lt;details&gt;</code> with a <code>.dropdown</code> class to defines a toggle-able block of content with a summary and additional details.</p> <p>You can have a <code>&lt;details&gt;</code> to defines a toggle-able block of content with a summary and additional details.</p>
<details class="dropdown"> <details>
<summary>Read more</summary> <summary>Read more</summary>
<p> <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra nec Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra nec
nulla vitae mollis. nulla vitae mollis.
</p> </p>
</details> </details>
<p>This can be coupled to a <code>.dropdown</code> and a couple of <code>.button</code> and <code>.card</code> classes to defines a dropdown button.</p>
<details class=dropdown>
<summary class="button outline">My Profile</summary>
<div class=card>
<p><a href="#">Edit</a></p>
<p><a href="#">Alerts&nbsp;<span class=tag>3</span></a></p>
<hr/>
<p><a href="#" class=text-error>Logout</a></p>
</div>
</details>
<details class=dropdown>
<summary class="button outline">Login</summary>
<form class="card row">
<input class=col-12 placeholder=username>
<input class=col-12 placeholder=password type=password>
<footer class=is-right>
<a class="button clear">Sign up</a>
<button type=submit>Sign in</button>
</footer>
</form>
</details>
</section> </section>

View File

@ -87,20 +87,27 @@ button {
display: flex; display: flex;
} }
.grouped > input:not(:last-child), .grouped > *:not(:last-child) {
.grouped > select:not(:last-child),
.grouped > .button:not(:last-child) {
margin-right: 16px; margin-right: 16px;
} }
.grouped.gapless > * {
margin: 0 0 0 -1px !important;
border-radius:0 !important;
}
.grouped.gapless > *:first-child {
margin: 0 !important;
border-radius:4px 0 0 4px !important;
}
.grouped.gapless > *:last-child {
border-radius:0 4px 4px 0 !important;
}
.button + .button { .button + .button {
margin-left: 1rem; margin-left: 1rem;
} }
.buttons > .button + .button {
margin-left: 0;
}
.button:hover, .button:hover,
[type="button"]:hover, [type="button"]:hover,
[type="reset"]:hover, [type="reset"]:hover,
@ -132,6 +139,7 @@ button:disabled:hover {
.button.success, .button.success,
[type="submit"] { [type="submit"] {
color: #fff; color: #fff;
z-index: 1; /* hightlight from other button's border when grouped */
background-color: #000; background-color: #000;
background-color: var(--color-primary); background-color: var(--color-primary);
} }