This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
HTML global attributes #211
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
872fa05
Add new recipe for html global attributes
Elchi3 2ef5156
Add html global attributes content structures
Elchi3 7cfc29f
Add contenteditable as a first global attribute
Elchi3 2c72ff4
Add html-global-attributes as a new case to build-json
Elchi3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
content/html/reference/global_attributes/contenteditable/contenteditable.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: 'contenteditable attribute' | ||
mdn_url: /en-US/docs/Web/HTML/Global_attributes/contenteditable | ||
interactive_example: | ||
url: https://interactive-examples.mdn.mozilla.net/pages/tabbed/attribute-contenteditable.html | ||
height: html-short | ||
browser_compatibility: html.global_attributes.contenteditable | ||
specifications: | ||
- https://html.spec.whatwg.org/multipage/interaction.html#attr-contenteditable | ||
- https://w3c.github.io/contentEditable/#contenteditable | ||
examples: | ||
- examples/using-contenteditable | ||
recipe: html-global-attribute | ||
--- | ||
|
||
## Short description | ||
|
||
The `contenteditable` global attribute is an enumerated attribute indicating if the element should be editable by the user. If so, the browser modifies its widget to allow editing. | ||
|
||
## Values | ||
|
||
The attribute must take one of the following values: | ||
|
||
- `true` or the *empty string*, which indicates that the element must be editable; | ||
- `false`, which indicates that the element must not be editable. | ||
|
||
If this attribute is not set, its default value is inherited from its parent element. | ||
|
||
## Usage notes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the recipe should include |
||
|
||
This attribute is an enumerated one and not a Boolean one. This means that the explicit usage of one of the values `true`, `false` or the *empty string* is mandatory and that a shorthand like `<label contenteditable>Example Label</label>` is not allowed. The correct usage is `<label contenteditable="true">Example Label</label>`. | ||
|
||
You can set the color used to draw the text insertion [caret](https://developer.mozilla.org/docs/Glossary/caret) with the CSS [`caret-color`](https://developer.mozilla.org/docs/Web/CSS/caret-color) property. | ||
|
||
## See also | ||
|
||
- [Making content editable](https://developer.mozilla.org/docs/Web/Guide/HTML/Editable_content) | ||
- [`HTMLElement.contentEditable`](https://developer.mozilla.org/docs/Web/API/HTMLElement/contentEditable) and [`HTMLElement.isContentEditable`](https://developer.mozilla.org/docs/Web/API/HTMLElement/isContentEditable) | ||
- The CSS [`caret-color`](https://developer.mozilla.org/docs/Web/CSS/caret-color) property | ||
- `HTMLElement` [`input` event](https://developer.mozilla.org/docs/Web/API/HTMLElement/input_event) which also fires for `contenteditable` elements |
16 changes: 16 additions & 0 deletions
16
content/html/reference/global_attributes/contenteditable/contributors.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[SphinxKnight](/en-US/profiles/SphinxKnight), | ||
[estelle](/en-US/profiles/estelle), | ||
[mdnwebdocs-bot](/en-US/profiles/mdnwebdocs-bot), | ||
[mfuji09](/en-US/profiles/mfuji09), | ||
[wbamberg](/en-US/profiles/wbamberg), | ||
[Wryn](/en-US/profiles/Wryn), | ||
[jpreuss](/en-US/profiles/jpreuss), | ||
[ExE-Boss](/en-US/profiles/ExE-Boss), | ||
[genezx](/en-US/profiles/genezx), | ||
[sideshowbarker](/en-US/profiles/sideshowbarker), | ||
[DragMeToProgramming](/en-US/profiles/DragMeToProgramming), | ||
[jpmedley](/en-US/profiles/jpmedley), | ||
[Sheppy](/en-US/profiles/Sheppy), | ||
[mfluehr](/en-US/profiles/mfluehr), | ||
[chrisdavidmills](/en-US/profiles/chrisdavidmills), | ||
[teoli](/en-US/profiles/teoli) |
3 changes: 3 additions & 0 deletions
3
...global_attributes/contenteditable/examples/using-contenteditable/description.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
You can set the `contenteditable` attribute on nearly any HTML element to make it editable. | ||
|
||
Here's a simple example which creates a `<div>` element whose contents the user can edit. |
3 changes: 3 additions & 0 deletions
3
...l/reference/global_attributes/contenteditable/examples/using-contenteditable/example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div contenteditable="true"> | ||
This text can be edited by the user. | ||
</div> |
10 changes: 10 additions & 0 deletions
10
content/html/reference/global_attributes/global_attributes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: HTML global attributes | ||
mdn_url: /en-US/docs/Web/HTML/Global_attributes | ||
recipe: landing-page | ||
related_content: /content/related_content/html.yaml | ||
link_lists: | ||
- title: Index of HTML global attributes | ||
directory: "/content/html/reference/global_attributes" | ||
--- | ||
This page lists all the HTML global attributes, which are created using tags... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
related_content: /content/related_content/html.yaml | ||
body: | ||
- prose.short_description | ||
- meta.interactive_example? | ||
- prose.values | ||
- prose.* | ||
- meta.examples | ||
- meta.specifications | ||
- meta.browser_compatibility | ||
- prose.see_also |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have
short_title
because it has a wordytitle
. To decide whethershort_title
is needed, imaginetitle
in a sidebar, under a heading describing what sorts of things these are:versus: