Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .grouped.gapless class #40

Merged
merged 2 commits into from
Sep 15, 2019
Merged
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
19 changes: 13 additions & 6 deletions dist/chota.css
Original file line number Diff line number Diff line change
Expand Up @@ -524,17 +524,23 @@ button {
display: -ms-flexbox;
display: flex;
}
.grouped > input:not(:last-child),
.grouped > select:not(:last-child),
.grouped > .button:not(:last-child) {
.grouped > *:not(:last-child) {
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 {
margin-left: 1rem;
}
.buttons > .button + .button {
margin-left: 0;
}
.button:hover,
[type="button"]:hover,
[type="reset"]:hover,
Expand Down Expand Up @@ -564,6 +570,7 @@ button:disabled:hover {
.button.success,
[type="submit"] {
color: #fff;
z-index: 1; /* hightlight from other button's border when grouped */
background-color: #000;
background-color: var(--color-primary);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/chota.min.css

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions docs/_includes/utilities.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,34 @@ <h4>Utilities</h4>
<li><code>hide-pr</code> - hides the element for printing</li>
</ul>
<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>
<details class="dropdown">
<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>
<summary>Read more</summary>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra nec
nulla vitae mollis.
</p>
</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>

22 changes: 15 additions & 7 deletions src/_form.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,25 @@ button {
display: flex;
}

.grouped > input:not(:last-child),
.grouped > select:not(:last-child),
.grouped > .button:not(:last-child) {
.grouped > *:not(:last-child) {
margin-right: 16px;
}

.button + .button {
margin-left: 1rem;
.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;
}

.buttons > .button + .button {
margin-left: 0;
.grouped.gapless > *:last-child {
border-radius:0 4px 4px 0 !important;
}

.button + .button {
margin-left: 1rem;
}

.button:hover,
Expand Down Expand Up @@ -132,6 +139,7 @@ button:disabled:hover {
.button.success,
[type="submit"] {
color: #fff;
z-index: 1; /* hightlight from other button's border when grouped */
background-color: #000;
background-color: var(--color-primary);
}
Expand Down