Skip to content

Commit 4eac76d

Browse files
committed
Improve list item styling
1 parent ca8e1ff commit 4eac76d

6 files changed

Lines changed: 14 additions & 172 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ziorwebdev/wordpress-blocks",
3-
"version": "1.2.12",
3+
"version": "1.2.13",
44
"description": "A collection of custom Gutenberg blocks designed to extend the WordPress block editor with icons, dynamic data, and flexible content composition.",
55
"type": "library",
66
"autoload": {

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/blocks/view.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.wp-block-zior-icon-list-item {
2+
display: flex;
3+
align-items: center;
4+
gap: 12px; // spacing between icon and content
5+
margin-top: 0;
6+
7+
>.wp-block-zior-icon-picker {
8+
flex-shrink: 0; // prevent shrinking
9+
}
10+
}
Lines changed: 0 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -1,169 +0,0 @@
1-
@use "../icon/icon-with-bg.scss" as *;
2-
@use "../icon/icon-without-bg.scss" as *;
3-
4-
.wp-block-zior-icon-picker {
5-
// This block has customizable padding, border-box makes that more predictable.
6-
box-sizing: border-box;
7-
8-
padding-left: 0;
9-
padding-right: 0;
10-
// Some themes set text-indent on all <ul>
11-
text-indent: 0;
12-
// Some themes give all <ul> default margin instead of padding.
13-
margin-left: 0;
14-
15-
// Unset background colors that can be inherited from Global Styles.
16-
background: none;
17-
18-
// Some themes add underlines, false underlines (via shadows), and borders to <a>.
19-
.wp-zior-icon a,
20-
.wp-zior-icon a:hover {
21-
text-decoration: none;
22-
border-bottom: 0;
23-
box-shadow: none;
24-
}
25-
26-
.wp-zior-icon {
27-
svg {
28-
width: 1em;
29-
height: 1em;
30-
}
31-
32-
span:not(.screen-reader-text) {
33-
margin-left: 0.5em;
34-
margin-right: 0.5em;
35-
font-size: 0.65em;
36-
}
37-
}
38-
39-
// Icon sizes.
40-
// Small.
41-
&.has-small-icon-size {
42-
font-size: 16px; // 16 makes for a quarter-padding that keeps the icon centered.
43-
}
44-
45-
// Normal/default.
46-
&,
47-
&.has-normal-icon-size {
48-
font-size: 24px;
49-
}
50-
51-
// Large.
52-
&.has-large-icon-size {
53-
font-size: 36px;
54-
}
55-
56-
// Huge.
57-
&.has-huge-icon-size {
58-
font-size: 48px;
59-
}
60-
61-
// Center flex items. This has an equivalent in editor.scss.
62-
// It also needs to override some of the default classes usually applied to the centering class.
63-
// align left must not be set, because this is the default (flex-start).
64-
&.aligncenter {
65-
justify-content: center;
66-
display: flex;
67-
}
68-
69-
&.alignright {
70-
justify-content: flex-end;
71-
}
72-
}
73-
74-
.wp-block-zior-icon {
75-
/* display: block; */
76-
border-radius: 9999px; // This makes it pill-shaped instead of oval, in cases where the image fed is not perfectly sized.
77-
78-
@media not (prefers-reduced-motion) {
79-
transition: transform 0.1s ease;
80-
}
81-
82-
// Dimensions.
83-
height: auto;
84-
85-
a {
86-
align-items: center;
87-
display: flex;
88-
line-height: 0;
89-
}
90-
91-
&:hover {
92-
transform: scale(1.1);
93-
}
94-
}
95-
96-
// This needs specificity because themes usually override it with things like .widget-area a.
97-
.wp-block-zior-icon-picker .wp-block-zior-icon.wp-zior-icon {
98-
display: inline-block;
99-
margin: 0;
100-
padding: 0;
101-
102-
.wp-block-zior-icon-anchor {
103-
104-
&,
105-
&:hover,
106-
&:active,
107-
&:visited,
108-
svg {
109-
color: currentColor;
110-
fill: currentColor;
111-
}
112-
}
113-
}
114-
115-
// Provide colors for a range of icons.
116-
:where(.wp-block-zior-icon-picker:not(.is-style-logos-only)) {
117-
// Generic items such as mail, feed, etc.
118-
@include icon-with-bg;
119-
}
120-
121-
// Treatment for logos only style.
122-
// The specificity for this selector has not been reduced to 0-1-0 as per
123-
// global styles variation selectors as the lack of background should be
124-
// enforced for this block style.
125-
:where(.wp-block-zior-icon-picker.is-style-logos-only) {
126-
.wp-zior-icon {
127-
background: none;
128-
129-
// Make these bigger.
130-
svg {
131-
width: 1.25em;
132-
height: 1.25em;
133-
}
134-
}
135-
136-
@include icon-without-bg;
137-
}
138-
139-
// Treatment for pill shape style.
140-
.wp-block-zior-icon-picker.is-style-pill-shape {
141-
.wp-zior-icon {
142-
width: auto;
143-
}
144-
}
145-
146-
// The following rules have their selector specificity set to 0-1-0 to
147-
// facilitate theme.json styling of the inner icon block padding.
148-
:root :where(.wp-block-zior-icon-picker .wp-zior-icon a) {
149-
padding: 0.25em;
150-
}
151-
152-
:root :where(.wp-block-zior-icon-picker.is-style-logos-only .wp-zior-icon a) {
153-
padding: 0;
154-
}
155-
156-
:root :where(.wp-block-zior-icon-picker.is-style-pill-shape .wp-zior-icon a) {
157-
padding-left: calc((2/3) * 1em);
158-
padding-right: calc((2/3) * 1em);
159-
}
160-
161-
// Ensure the Snapchat label is visible when no custom
162-
// icon color or background color is set.
163-
.wp-block-zior-icon-picker:not(.has-icon-color):not(.has-icon-background-color) {
164-
.wp-zior-icon-snapchat {
165-
.wp-block-zior-icon-label {
166-
color: #000;
167-
}
168-
}
169-
}

resources/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use "./blocks/icon-picker/style.scss" as *;
22
@use "./blocks/add-to-cart/style.scss" as *;
33
@use "./blocks/product-rating/style.scss" as *;
4+
@use "./blocks/icon-list-item/style.scss" as *;
45
@use "common.scss" as *;

0 commit comments

Comments
 (0)