Skip to content

Commit

Permalink
Add row forms
Browse files Browse the repository at this point in the history
Closes #70.
  • Loading branch information
Steffo99 committed Mar 30, 2024
1 parent c347de5 commit 6115354
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,20 @@ <h4>
</form>
</section>
</div>
<section class="panel box" id="panel-form-row">
<h3>
Row form
</h3>
<p>
A <dfn id="dfn-form-row">row form</dfn> is a <b>block form</b> aligning elements to a single horizontal row.
</p>
<form class="panel form-row">
<span>Login</span>
<input type="text" placeholder="Username">
<input type="password" placeholder="Password">
<input type="submit" value="Login">
</form>
</section>
</main>
<footer>
<p>
Expand Down
23 changes: 23 additions & 0 deletions src/rulesets/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,29 @@
}
}

@{form-row} {
display: flex;
flex-direction: row;

> @{all} {
flex-basis: 100%;
flex-shrink: 1;
justify-content: space-between;
align-items: center;
}

> @{form-row-text} {
flex-basis: unset;
flex-shrink: 0;
flex-grow: 1;
text-align: right;
margin: auto 0;

.use-font-group(label);
.map-hsl-group(current; primary);
}
}

//</editor-fold>

/// ===== Text =====
Expand Down
3 changes: 3 additions & 0 deletions src/selectorsets/module.less
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
@form-flex-content: ~":where(.form-flex-content)";
@form-flex-choice: ~":where(.form-flex-choice)";

@form-row: ~":where(.form-row)";
@form-row-text: ~":where(.form-row-text)";

@text-anchor: ~":where(.text-anchor)";
@text-idiomatic: ~":where(.text-idiomatic)";
@text-emphasis: ~":where(.text-emphasis)";
Expand Down
3 changes: 3 additions & 0 deletions src/selectorsets/root.less
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
@form-flex-content: ~':where(.form-flex-content, p)';
@form-flex-choice: ~':where(.form-flex-choice, label)';

@form-row: ~":where(.form-row)";
@form-row-text: ~":where(.form-row-text, span, label)";

@text-anchor: ~":where(a)";
@text-idiomatic: ~":where(i)";
@text-emphasis: ~":where(em)";
Expand Down

0 comments on commit 6115354

Please sign in to comment.