Skip to content

Commit

Permalink
refactor: more icon alignment (#293)
Browse files Browse the repository at this point in the history
* refactor: polish icon alignment

* refactor: polish icon alignment, missing piece

* fix: add space between icon links in a paragraph

* fix: demo a paragraph with two links

* docs: comment on an obtuse selector
  • Loading branch information
wesleyboar authored Jan 10, 2024
1 parent ecf5fed commit 99a6f66
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist/components/c-button.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components/c-card.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components/c-form--login.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components/c-form.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components/cortal.icon.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-styles.base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-styles.cms.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-styles.docs.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-styles.portal.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/trumps/s-form--login.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/trumps/s-form.css

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/lib/_imports/components/c-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
--mid-width: 110px;
--max-width: 130px;

display: inline-block;
display: inline-flex;
align-items: baseline;

/* To ensure identical <button> and <a> instances have same width */
box-sizing: border-box;
Expand Down
10 changes: 8 additions & 2 deletions src/lib/_imports/components/c-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,14 @@

/* Elements */

:--c-card > a:not(:--c-button), :--c-card > p > a:only-child:not(:--c-button) {
display: flex;
:--c-card > a:not(:--c-button),
:--c-card > p > a:not(:--c-button) {
display: inline-flex;
align-items: baseline;
}
/* I.e. one of multiple icon links within a p tag */
:--c-card > p > a:not(:--c-button):has(.icon):not(:last-child) {
margin-right: 1rem;
}
:--c-card > :is(:--action) {
vertical-align: middle;
Expand Down
2 changes: 2 additions & 0 deletions src/lib/_imports/components/c-card/_c-card--many-variable.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
<a href="#"><i class="icon icon-push-left">&gt;</i> Learn less</a>
<a href="#"><i class="icon icon-push-right">&gt;</i> Learn more</a>
</p>
<p>A regular paragraph with <a href="#">a link</a>
and <a href="#">another link</a> before the end, should not be affected.</p>
</article>
<article class="c-card c-card--{{this._self.name}}">
<h3>Card - {{this._self.label}}</h3>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/_imports/components/cortal.icon.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ Styleguide Components.Cortal.Icon

/* To tweak action icon appearance and layout */
:--c-card > :is(:--action) > .icon:first-child,
p > :is(:--action):only-child > .icon:first-child {
p > :is(:--action) > .icon:first-child {
margin-right: 10px;
font-size: 1.2em;

position: relative;
top: 0.05em;
top: 0.2em;
}


Expand Down

0 comments on commit 99a6f66

Please sign in to comment.