Skip to content

Commit ab26557

Browse files
Merge pull request #207 from AllThingsSmitty/feature_update
Feature update
2 parents b5b4219 + b1aebff commit ab26557

File tree

2 files changed

+38
-16
lines changed

2 files changed

+38
-16
lines changed

CONTRIBUTING.md

+15-16
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,32 @@
22

33
Please note that this project is released with a [Contributor Code of Conduct](CODE-OF-CONDUCT.md). By participating in this project you agree to abide by its terms.
44

5-
65
## Table of Contents
76

87
- [Adding to This List](#adding-to-this-list)
98
- [Updating Your Pull Request](#updating-your-pull-request)
109

11-
1210
## Adding to This List
1311

1412
Please ensure your pull request adheres to the following guidelines:
1513

16-
* Search open and closed PRs to avoid duplicate suggestions.
17-
* Only submit CSS tips that you think would be useful to others. This implies each tip has enough succinct content to describe why it's useful.
18-
* Add your tip at the bottom of the [README](https://github.com/AllThingsSmitty/css-protips/blob/master/README.md) document. Add a link to your tip at the bottom of the table of contents.
19-
* Use [title-case](https://titlecaseconverter.com/).
20-
* Code formatting should follow standard [CSSLint](http://www.csslint.net) default settings, including:
21-
* Indent with two spaces
22-
* Use shorthand, e.g., `margin: 10px 10px 5px;`
23-
* Use double quotes, e.g., `background: url("logo.svg");`
24-
* Sort properties alphabetically
25-
* Make sure your text editor is set to remove trailing whitespace.
26-
* Check your spelling and grammar.
27-
* The PR should have a useful title.
14+
- Search open and closed PRs to avoid duplicate suggestions.
15+
- Only submit CSS tips that you think would be useful to others. This implies each tip has enough succinct content to describe why it's useful.
16+
- Add your tip at the bottom of the [README](https://github.com/AllThingsSmitty/css-protips/blob/master/README.md) document. Add a link to your tip at the bottom of the table of contents.
17+
- Use [title-case](https://titlecaseconverter.com/).
18+
- Code formatting should follow standard [CSSLint](http://www.csslint.net) default settings, including:
19+
- Indent with two spaces
20+
- Use shorthand, e.g., `margin: 10px 10px 0.5rem;`
21+
- Use double quotes, e.g., `background: url("logo.svg");`
22+
- Use leading zeros with numberic values, e.g., `padding: 0.75rem;`
23+
- Sort properties alphabetically
24+
- **Avoid letting your code formatter format other section of the README file.**
25+
- Make sure your text editor is set to remove trailing whitespace.
26+
- Check your spelling and grammar.
27+
- The PR should have a useful title.
2828

2929
Thank you for your suggestions!
3030

31-
3231
## Updating Your Pull Request
3332

34-
Sometimes a maintainer will ask you to edit your pull request before it's included. This is normally due to spelling errors or because your PR didn't match the above guidelines guidelines. [This write-up](https://github.com/RichardLitt/knowledge/blob/master/github/amending-a-commit-guide.md) covers the different ways you can change a pull request.
33+
Sometimes a maintainer will ask you to edit your pull request before it's included. This is normally due to spelling errors or because your PR didn't match the above guidelines guidelines. [This write-up](https://github.com/RichardLitt/knowledge/blob/master/github/amending-a-commit-guide.md) covers the different ways you can change a pull request.

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ A collection of tips to help take your CSS skills pro.
4646
1. [Use Pointer Events to Control Mouse Events](#use-pointer-events-to-control-mouse-events)
4747
1. [Set `display: none` on Line Breaks Used as Spacing](#set-display-none-on-line-breaks-used-as-spacing)
4848
1. [Use `:empty` to Hide Empty HTML Elements](#use-empty-to-hide-empty-html-elements)
49+
1. [Use `margin-inline` instead of `margin`](#use-margin-inline-instead-of-margin)
4950

5051
### Use a CSS Reset
5152

@@ -675,6 +676,28 @@ Current versions of Chrome, Firefox, Safari, and Edge.
675676

676677
<sup>[Back to top](#table-of-contents)</sup>
677678

679+
### Use `margin-inline` instead of `margin`
680+
681+
`margin-inline` defines the inline start and end margins of an element. So instead of using `margin-left` and `margin-right` we can use the inline property to define both.
682+
683+
```css
684+
.div {
685+
margin-inline: auto;
686+
}
687+
```
688+
689+
The same can be done for `margin-block` with defines the block start and end margins, i.e., `margin-top` and `margin-bottom`.
690+
691+
```css
692+
.div {
693+
margin-block: auto;
694+
}
695+
```
696+
697+
#### [Demo](https://codepen.io/AllThingsSmitty/pen/PwoOQGB)
698+
699+
<sup>[Back to top](#table-of-contents)</sup>
700+
678701
## Translations
679702

680703
> [!NOTE]

0 commit comments

Comments
 (0)