pub trait GlobalAttributes {
Show 27 associated constants and 0 method const access_key: Attribute = Attribute; const autocapitalize: Attribute = Attribute; const autofocus: Attribute = Attribute; const class: Attribute = Attribute; const contenteditable: Attribute = Attribute; const dir: Attribute = Attribute; const draggable: Attribute = Attribute; const enterkeyhint: Attribute = Attribute; const hidden: Attribute = Attribute; const id: Attribute = Attribute; const inert: Attribute = Attribute; const inputmode: Attribute = Attribute; const is: Attribute = Attribute; const itemid: Attribute = Attribute; const itemprop: Attribute = Attribute; const itemref: Attribute = Attribute; const itemscope: Attribute = Attribute; const itemtype: Attribute = Attribute; const lang: Attribute = Attribute; const nonce: Attribute = Attribute; const popover: Attribute = Attribute; const slot: Attribute = Attribute; const spellcheck: Attribute = Attribute; const style: Attribute = Attribute; const tabindex: Attribute = Attribute; const title: Attribute = Attribute; const translate: Attribute = Attribute;
}
Expand description

Global HTML attributes.

This trait must be in scope to use well-known attributes such as class and id. This trait is implemented by every HTML element specified in crate::html_elements.

Usage With Custom Elements

use hypertext::{maud, GlobalAttributes}; // `GlobalAttributes` must be in scope!

mod html_elements {
    #![allow(non_camel_case_types)]

    pub use hypertext::html_elements::*;
    use hypertext::GlobalAttributes;

    pub struct custom_element;

    impl GlobalAttributes for custom_element {}
}

assert_eq!(
    maud! { custom-element title="abc" { "Hello, world!" } }.render(),
    r#"<custom-element title="abc">Hello, world!</custom-element>"#,
);

Provided Associated Constants§

source

const access_key: Attribute = Attribute

Used as a guide for creating a keyboard shortcut that activates or focuses the element.

source

const autocapitalize: Attribute = Attribute

The autocapitalization behavior to use when the text is edited through non-keyboard methods.

source

const autofocus: Attribute = Attribute

Indicates whether the element should be automatically focused when the page is loaded.

source

const class: Attribute = Attribute

The class of the element.

source

const contenteditable: Attribute = Attribute

Whether the element is editable.

source

const dir: Attribute = Attribute

The text directionality of the element.

source

const draggable: Attribute = Attribute

Whether the element is draggable.

source

const enterkeyhint: Attribute = Attribute

A hint as to what the enter key should do.

source

const hidden: Attribute = Attribute

Whether the element is hidden from view.

source

const id: Attribute = Attribute

A unique identifier for the element.

source

const inert: Attribute = Attribute

Mark an element and its children as inert, disabling interaction.

source

const inputmode: Attribute = Attribute

Specifies what kind of input mechanism would be most helpful for users entering content.

source

const is: Attribute = Attribute

Specify which element this is a custom variant of.

source

const itemid: Attribute = Attribute

A global identifier for the item.

source

const itemprop: Attribute = Attribute

A property that the item has.

source

const itemref: Attribute = Attribute

A list of additional elements to crawl to find the name-value pairs of the item.

source

const itemscope: Attribute = Attribute

Creates a new item, a group of name-value pairs.

source

const itemtype: Attribute = Attribute

The item types of the item.

source

const lang: Attribute = Attribute

The language of the element.

source

const nonce: Attribute = Attribute

A cryptographic nonce (“number used once”) which can be used by Content Security Policy to determine whether or not a given fetch will be allowed to proceed.

source

const popover: Attribute = Attribute

When specified, the element won’t be rendered until it becomes shown, at which point it will be rendered on top of other page content.

source

const slot: Attribute = Attribute

The slot the element is inserted in.

source

const spellcheck: Attribute = Attribute

Whether the element is spellchecked or not.

source

const style: Attribute = Attribute

The CSS styling to apply to the element.

source

const tabindex: Attribute = Attribute

Customize the index of the element for sequential focus navigation.

source

const title: Attribute = Attribute

A text description of the element.

source

const translate: Attribute = Attribute

Whether the element is to be translated when the page is localized.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl GlobalAttributes for a

source§

impl GlobalAttributes for abbr

source§

impl GlobalAttributes for address

source§

impl GlobalAttributes for area

source§

impl GlobalAttributes for article

source§

impl GlobalAttributes for aside

source§

impl GlobalAttributes for audio

source§

impl GlobalAttributes for b

source§

impl GlobalAttributes for base

source§

impl GlobalAttributes for bdi

source§

impl GlobalAttributes for bdo

source§

impl GlobalAttributes for blockquote

source§

impl GlobalAttributes for body

source§

impl GlobalAttributes for br

source§

impl GlobalAttributes for button

source§

impl GlobalAttributes for canvas

source§

impl GlobalAttributes for caption

source§

impl GlobalAttributes for cite

source§

impl GlobalAttributes for code

source§

impl GlobalAttributes for col

source§

impl GlobalAttributes for colgroup

source§

impl GlobalAttributes for data

source§

impl GlobalAttributes for datalist

source§

impl GlobalAttributes for dd

source§

impl GlobalAttributes for del

source§

impl GlobalAttributes for details

source§

impl GlobalAttributes for dfn

source§

impl GlobalAttributes for dialog

source§

impl GlobalAttributes for div

source§

impl GlobalAttributes for dl

source§

impl GlobalAttributes for dt

source§

impl GlobalAttributes for em

source§

impl GlobalAttributes for embed

source§

impl GlobalAttributes for fieldset

source§

impl GlobalAttributes for figcaption

source§

impl GlobalAttributes for figure

source§

impl GlobalAttributes for form

source§

impl GlobalAttributes for h1

source§

impl GlobalAttributes for h2

source§

impl GlobalAttributes for h3

source§

impl GlobalAttributes for h4

source§

impl GlobalAttributes for h5

source§

impl GlobalAttributes for h6

source§

impl GlobalAttributes for head

source§

impl GlobalAttributes for header

source§

impl GlobalAttributes for hgroup

source§

impl GlobalAttributes for hr

source§

impl GlobalAttributes for html

source§

impl GlobalAttributes for i

source§

impl GlobalAttributes for iframe

source§

impl GlobalAttributes for img

source§

impl GlobalAttributes for input

source§

impl GlobalAttributes for ins

source§

impl GlobalAttributes for kbd

source§

impl GlobalAttributes for label

source§

impl GlobalAttributes for legend

source§

impl GlobalAttributes for li

source§

impl GlobalAttributes for main

source§

impl GlobalAttributes for map

source§

impl GlobalAttributes for mark

source§

impl GlobalAttributes for menu

source§

impl GlobalAttributes for meta

source§

impl GlobalAttributes for meter

source§

impl GlobalAttributes for nav

source§

impl GlobalAttributes for noscript

source§

impl GlobalAttributes for object

source§

impl GlobalAttributes for ol

source§

impl GlobalAttributes for optgroup

source§

impl GlobalAttributes for option

source§

impl GlobalAttributes for output

source§

impl GlobalAttributes for p

source§

impl GlobalAttributes for picture

source§

impl GlobalAttributes for pre

source§

impl GlobalAttributes for progress

source§

impl GlobalAttributes for q

source§

impl GlobalAttributes for rp

source§

impl GlobalAttributes for rt

source§

impl GlobalAttributes for ruby

source§

impl GlobalAttributes for s

source§

impl GlobalAttributes for samp

source§

impl GlobalAttributes for script

source§

impl GlobalAttributes for section

source§

impl GlobalAttributes for select

source§

impl GlobalAttributes for slot

source§

impl GlobalAttributes for small

source§

impl GlobalAttributes for source

source§

impl GlobalAttributes for span

source§

impl GlobalAttributes for strong

source§

impl GlobalAttributes for style

source§

impl GlobalAttributes for sub

source§

impl GlobalAttributes for summary

source§

impl GlobalAttributes for sup

source§

impl GlobalAttributes for table

source§

impl GlobalAttributes for tbody

source§

impl GlobalAttributes for td

source§

impl GlobalAttributes for template

source§

impl GlobalAttributes for textarea

source§

impl GlobalAttributes for tfoot

source§

impl GlobalAttributes for th

source§

impl GlobalAttributes for thead

source§

impl GlobalAttributes for time

source§

impl GlobalAttributes for title

source§

impl GlobalAttributes for tr

source§

impl GlobalAttributes for track

source§

impl GlobalAttributes for u

source§

impl GlobalAttributes for ul

source§

impl GlobalAttributes for var

source§

impl GlobalAttributes for video

source§

impl GlobalAttributes for wbr