Skip to content

Commit 0a1fb8b

Browse files
authoredDec 27, 2022
npm run format
1 parent 18d4aa2 commit 0a1fb8b

7 files changed

+110
-116
lines changed
 

‎CODE_OF_CONDUCT.md

+33-48
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,60 @@
22

33
## Our Pledge
44

5-
In the interest of fostering an open and welcoming environment, we as
6-
contributors and maintainers pledge to making participation in our project and
7-
our community a harassment-free experience for everyone, regardless of age, body
8-
size, disability, ethnicity, sex characteristics, gender identity and expression,
9-
level of experience, education, socio-economic status, nationality, personal
10-
appearance, race, religion, or sexual identity and orientation.
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
6+
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
7+
disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education,
8+
socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
119

1210
## Our Standards
1311

14-
Examples of behavior that contributes to creating a positive environment
15-
include:
12+
Examples of behavior that contributes to creating a positive environment include:
1613

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
14+
- Using welcoming and inclusive language
15+
- Being respectful of differing viewpoints and experiences
16+
- Gracefully accepting constructive criticism
17+
- Focusing on what is best for the community
18+
- Showing empathy towards other community members
2219

2320
Examples of unacceptable behavior by participants include:
2421

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
22+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
23+
- Trolling, insulting/derogatory comments, and personal or political attacks
24+
- Public or private harassment
25+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
26+
- Other conduct which could reasonably be considered inappropriate in a professional setting
3327

3428
## Our Responsibilities
3529

36-
Project maintainers are responsible for clarifying the standards of acceptable
37-
behavior and are expected to take appropriate and fair corrective action in
38-
response to any instances of unacceptable behavior.
30+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
31+
appropriate and fair corrective action in response to any instances of unacceptable behavior.
3932

40-
Project maintainers have the right and responsibility to remove, edit, or
41-
reject comments, commits, code, wiki edits, issues, and other contributions
42-
that are not aligned to this Code of Conduct, or to ban temporarily or
43-
permanently any contributor for other behaviors that they deem inappropriate,
44-
threatening, offensive, or harmful.
33+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
34+
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
35+
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
4536

4637
## Scope
4738

48-
This Code of Conduct applies both within project spaces and in public spaces
49-
when an individual is representing the project or its community. Examples of
50-
representing a project or community include using an official project e-mail
51-
address, posting via an official social media account, or acting as an appointed
52-
representative at an online or offline event. Representation of a project may be
53-
further defined and clarified by project maintainers.
39+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
40+
project or its community. Examples of representing a project or community include using an official project e-mail
41+
address, posting via an official social media account, or acting as an appointed representative at an online or offline
42+
event. Representation of a project may be further defined and clarified by project maintainers.
5443

5544
## Enforcement
5645

57-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at webcomponentsguide@keithcirkel.co.uk. All
59-
complaints will be reviewed and investigated and will result in a response that
60-
is deemed necessary and appropriate to the circumstances. The project team is
61-
obligated to maintain confidentiality with regard to the reporter of an incident.
62-
Further details of specific enforcement policies may be posted separately.
46+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
47+
webcomponentsguide@keithcirkel.co.uk. All complaints will be reviewed and investigated and will result in a response
48+
that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality
49+
with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
6350

64-
Project maintainers who do not follow or enforce the Code of Conduct in good
65-
faith may face temporary or permanent repercussions as determined by other
66-
members of the project's leadership.
51+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
52+
repercussions as determined by other members of the project's leadership.
6753

6854
## Attribution
6955

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
56+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at
57+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
7258

7359
[homepage]: https://www.contributor-covenant.org
7460

75-
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
61+
For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq

‎CONTRIBUTING.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Contributing
22

3-
Contributions are always welcome! Before contributing, please read the [code of conduct](https://github.com/WebComponentsGuide/webcomponents.guide/blob/main/CODE_OF_CONDUCT.md).
3+
Contributions are always welcome! Before contributing, please read the
4+
[code of conduct](https://github.com/WebComponentsGuide/webcomponents.guide/blob/main/CODE_OF_CONDUCT.md).
45

56
## Where to start
67

78
- If you've found typos or mistakes in the documentation, please go right ahead and raise a PR!.
8-
- If you're looking for issues to resolve, a good place to start is the [help wanted label](https://github.com/WebComponentsGuide/webcomponents.guide/labels/help%20wanted) and/or [good first issue label](https://github.com/WebComponentsGuide/webcomponents.guide/labels/good%20first%20issue).
9-
- If you have to contribute to bigger pieces, like an idea or new section, tutorial, or blog post, then please raise an issue first! This way we can discuss an action plan and figure out a high level overview of what should be written.
9+
- If you're looking for issues to resolve, a good place to start is the
10+
[help wanted label](https://github.com/WebComponentsGuide/webcomponents.guide/labels/help%20wanted) and/or
11+
[good first issue label](https://github.com/WebComponentsGuide/webcomponents.guide/labels/good%20first%20issue).
12+
- If you have to contribute to bigger pieces, like an idea or new section, tutorial, or blog post, then please raise an
13+
issue first! This way we can discuss an action plan and figure out a high level overview of what should be written.
1014

1115
### Setup
1216

@@ -19,8 +23,10 @@ $ npm install
1923
$ npm start
2024
```
2125

22-
Once this is done you can visit http://localhost:8080/ to see the local copy of the website. As you edit files the website will automatically rebuild, and you can see the changes reflected in your browser.
26+
Once this is done you can visit http://localhost:8080/ to see the local copy of the website. As you edit files the
27+
website will automatically rebuild, and you can see the changes reflected in your browser.
2328

2429
### Running checks/tests
2530

26-
When making contributions, please make sure to run `npm run check`, to ensure your contributions are correctly formatted and spelled. You can also run `npm run format` to automatically format all files.
31+
When making contributions, please make sure to run `npm run check`, to ensure your contributions are correctly formatted
32+
and spelled. You can also run `npm run format` to automatically format all files.

‎learn/components/autonomous-vs-customized-elements.md

+37-37
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ tag and extending `HTMLElement`. However, each style comes with different trade-
1010
[defining-a-component]: /learn/components/defining-a-component
1111

1212
Choosing a type of component to build will depend on a lot of factors. _Autonomous Custom Elements_ give you a blank
13-
canvas to work with. _Customized Built-ins_ **extend** the element you're customizing. Here are some considerations to think
14-
about:
13+
canvas to work with. _Customized Built-ins_ **extend** the element you're customizing. Here are some considerations to
14+
think about:
1515

1616
### Tag Name
1717

18-
Perhaps the most obvious difference between the two is that _Autonomous Custom Elements_ get to create an entirely new tag
19-
name, and this means if you're querying for the element in the DOM, you'll need to reference that tag name, e.g.
18+
Perhaps the most obvious difference between the two is that _Autonomous Custom Elements_ get to create an entirely new
19+
tag name, and this means if you're querying for the element in the DOM, you'll need to reference that tag name, e.g.
2020
`.querySelector('fancy-button')` will return the first `<fancy-button>`.
2121

22-
With _Customized Built-in_ elements, the tag name must match the element you're customising. For example if you wanted to
23-
customise a `<button>` element then your HTML will take the shape of `<button is="fancy-button>`. In order to query this
24-
element you'd need to use an _attribute selector_, for example `.querySelector('button[is="fancy-button"]')`. This also
25-
means existing code that queries for `button` elements will also find your _Customized Built-ins_. Calling
26-
`.querySelectorAll('button')` will find all button elements, including ones which are _Customized Built-in elements_. The
27-
way to find _non-Customized Built-ins_ is to use a selector like: `.querySelectorAll('button:not([is])')`.
22+
With _Customized Built-in_ elements, the tag name must match the element you're customising. For example if you wanted
23+
to customise a `<button>` element then your HTML will take the shape of `<button is="fancy-button>`. In order to query
24+
this element you'd need to use an _attribute selector_, for example `.querySelector('button[is="fancy-button"]')`. This
25+
also means existing code that queries for `button` elements will also find your _Customized Built-ins_. Calling
26+
`.querySelectorAll('button')` will find all button elements, including ones which are _Customized Built-in elements_.
27+
The way to find _non-Customized Built-ins_ is to use a selector like: `.querySelectorAll('button:not([is])')`.
2828

2929
This difference in tag name also effects how you'll select for these elements in CSS. There are additional CSS
3030
considerations...
@@ -34,16 +34,16 @@ considerations...
3434
Given _Autonomous Custom Elements_ have their own tag, they are unlikely to conflict with existing CSS. They can have
3535
_classes_ added to them, and so can be styled by existing CSS but it is opt-in.
3636

37-
As _Customised Built-ins_ keep their tags (e.g. `<button is="fancy-button">`) any CSS that has rules like `button {}` will
38-
apply. This means if you have some existing CSS that applies to _built-ins_, it'll also apply to the _Customized built-ins_.
39-
This also includes the default _user agent CSS_.
37+
As _Customised Built-ins_ keep their tags (e.g. `<button is="fancy-button">`) any CSS that has rules like `button {}`
38+
will apply. This means if you have some existing CSS that applies to _built-ins_, it'll also apply to the _Customized
39+
built-ins_. This also includes the default _user agent CSS_.
4040

41-
All _built-ins_ have some _user-agent CSS_ supplied already, for example `div` elements have `display: block;`, `<button>`
42-
elements are styled to look like your operating systems buttons. _Customised Built-ins_ will also get these styles, so
43-
`<button is="fancy-button">` will look the same as `<button>` until you customise it further.
41+
All _built-ins_ have some _user-agent CSS_ supplied already, for example `div` elements have `display: block;`,
42+
`<button>` elements are styled to look like your operating systems buttons. _Customised Built-ins_ will also get these
43+
styles, so `<button is="fancy-button">` will look the same as `<button>` until you customise it further.
4444

45-
If you want to customize a _built-in_ by applying only new styles and not adding any new logic, it might be best to use a
46-
CSS class instead. The main benefit of _Customized Built-ins_ is to extend or add new logic.
45+
If you want to customize a _built-in_ by applying only new styles and not adding any new logic, it might be best to use
46+
a CSS class instead. The main benefit of _Customized Built-ins_ is to extend or add new logic.
4747

4848
If you create an _Autonomous Custom Element_ (e.g. `<fancy-button>`) you'll need to style it from scratch as _Autonomous
4949
Custom Elements_ have no default CSS. You will probably want to add some CSS to these elements - even if it's just
@@ -54,8 +54,8 @@ One other thing to think about with regard to styling is _encapsulated styles_ w
5454
### ShadowDOM
5555

5656
_Autonomous Custom Elements_ can make use of the [_ShadowDOM_][shadowdom]. Only a limited set of _built-ins_ can use the
57-
_ShadowDOM_. If you want to alter any nested elements, it's a great idea to use _ShadowDOM_, and so you probably won't want
58-
to customise a _built-in_. Here's a list of _built-ins_ that you can customise with _ShadowDOM_:
57+
_ShadowDOM_. If you want to alter any nested elements, it's a great idea to use _ShadowDOM_, and so you probably won't
58+
want to customise a _built-in_. Here's a list of _built-ins_ that you can customise with _ShadowDOM_:
5959

6060
- `<article>`
6161
- `<aside>`
@@ -70,13 +70,13 @@ to customise a _built-in_. Here's a list of _built-ins_ that you can customise w
7070
- `<section>`
7171
- `<span>`
7272

73-
_ShadowDOM_ can be really useful for providing encapsulated markup and styles. Styles within _ShadowDOM_ don't
74-
effect the rest of the page, and so it can be a really useful place to add styles to your elements. If this is a high
75-
priority, you might find using an _Autonomous Custom Element_ to be a better choice than the limited set of built-ins
76-
which can use _ShadowDOM_.
73+
_ShadowDOM_ can be really useful for providing encapsulated markup and styles. Styles within _ShadowDOM_ don't effect
74+
the rest of the page, and so it can be a really useful place to add styles to your elements. If this is a high priority,
75+
you might find using an _Autonomous Custom Element_ to be a better choice than the limited set of built-ins which can
76+
use _ShadowDOM_.
7777

78-
_ShadowDOM_ also provides elements with the ability to chose how nested elements render. An ability that many _built-ins_
79-
already have...
78+
_ShadowDOM_ also provides elements with the ability to chose how nested elements render. An ability that many
79+
_built-ins_ already have...
8080

8181
[shadowdom]: /learn/components/shadowdom
8282

@@ -85,11 +85,11 @@ already have...
8585
Many _built-in_ elements will only allow certain tags to nest inside ([you can read more about _Content Categories_ on
8686
MDN][content-categories]). For example a `<button>` tag only allows _[phrasing content]_ tags like `<b>`, `<strong>`,
8787
`<span>` and so on. Some elements, for example the `<details>` element will have specific associations with other
88-
elements. A `<summary>` tag can only exist as the _first child_ to a `<details>` element, and if it doesn't exist, it will
89-
be created by the `<details>` tag.
88+
elements. A `<summary>` tag can only exist as the _first child_ to a `<details>` element, and if it doesn't exist, it
89+
will be created by the `<details>` tag.
9090

91-
_Customized Built-ins_ match the semantics of the _built-in_ they're customising, and that cannot be changed. So for example
92-
a `<button is="fancy-button">` will only allow nested _[phrasing content][phrasing-content]_ tags just like a
91+
_Customized Built-ins_ match the semantics of the _built-in_ they're customising, and that cannot be changed. So for
92+
example a `<button is="fancy-button">` will only allow nested _[phrasing content][phrasing-content]_ tags just like a
9393
`<button>`.
9494

9595
_Autonomous Custom Elements_ allow any nested tag by default. This can be customised with _ShadowDOM_, but the default
@@ -121,15 +121,15 @@ into issues with code that isn't expecting to see the newly added logic.
121121

122122
### Accessibility
123123

124-
_Customised Built-ins_ have very good accessibility information built right into them. Most have an _implicit role_ which
125-
means that assistive technologies know how to interpret them. For example using a _screen reader_, it is possible to
126-
navigate through all of the headings in a webpage, and the purpose of form controls is explained as each one is focused
127-
(e.g. buttons are read out not only by their label but also referred to as "buttons").
124+
_Customised Built-ins_ have very good accessibility information built right into them. Most have an _implicit role_
125+
which means that assistive technologies know how to interpret them. For example using a _screen reader_, it is possible
126+
to navigate through all of the headings in a webpage, and the purpose of form controls is explained as each one is
127+
focused (e.g. buttons are read out not only by their label but also referred to as "buttons").
128128

129129
_Autonomous Custom Elements_, on the other hand, do not have any accessibility information built into them. Assistive
130-
technologies such as _screen readers_ will read the contents of the element as if it were plain text; treating it the same
131-
as a `<div>` or `<span>`. It's possible to customise how assistive technology like _screen readers_ handle your element by
132-
using the [Accessible Internet Rich Applications (or ARIA)][aria] APIs, such as the `role=` attribute.
130+
technologies such as _screen readers_ will read the contents of the element as if it were plain text; treating it the
131+
same as a `<div>` or `<span>`. It's possible to customise how assistive technology like _screen readers_ handle your
132+
element by using the [Accessible Internet Rich Applications (or ARIA)][aria] APIs, such as the `role=` attribute.
133133

134134
Accessibility can be hard to get right. Many assistive tools behave differently, and much like browsers, support is not
135135
universal and consistent. It's always worth getting comfortable with these tools, and testing your web applications

0 commit comments

Comments
 (0)
Please sign in to comment.