Skip to content

Global pat-inject  #703

Open
Open
@cornae

Description

@cornae

Context

In the beginning when the web was void and empty we used a pat-inject statement here and there to smoothen things up. Today I fill my days writing class="pat-inject" data-pat-inject="history: record" on every possible link. History: record is something that we want almost every time.

Problem

We could make it a default and have history: no-record for the exceptions. But the pat-inject class is still needed on every link and form which is a lot of work. Also we have no control over links in rich texts written by editors. And those should use inject too for smooth operation of applications such as Quaive.

Proposal

I propose to introduce a 'selector' property for pat-inject. The selector property allow for pointing to the element(s) on which the inject statement should take effect. The default value is 'self' like it is now. The selector would within the context of the container element the statement is placed on.

Example:

<body class="pat-inject" 
      data-pat-inject="selector: a,form; source: #main; target: #main; history: record">

The above example would apply basic injection behaviour for everthing that loads content on the site.

It should be possible to overrule the inject statement. For instance when an injection is sometimes not desired or when another combination of source and target is desired.

To a designer it would feel natural to overrule property by property. But I think that would be too complex. I would propose to overrule pat-inject on a link or form element altogether simply by putting a class pat-inject on the element. It will accept only its own properties.

When no injection is required on an element that matches the pat-inject selector of its container, I propose the following: class="pat-inject" data-pat-inject="none".

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions