Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

Add _blank to "location", or create equivalent of JS "open" in ACSS to handle same scenario. #350

Closed bob2517 closed 7 months ago

bob2517 commented 8 months ago

As per title. Should be able to get that onto the latest branch at the weekend.

bob2517 commented 8 months ago

Create a new "open" command to align to JS, and allow specifying the target window per the JS rules.

https://developer.mozilla.org/en-US/docs/Web/API/Window/open

Ie. allow things like noreferrer and all those things.

bob2517 commented 7 months ago

Now on branch, same syntax as JS, with up to 3 strings eg.

button:click {
    open: "https://activecss.org" "_blank" "popup,noreferrer,noopener,width=500,height=500";
}

See MDN link in previous comment for instructions.

Note that doing a straight link in HTML is superior as a general rule, and adding a:not([target="_blank") { prevent-default: true; } (or a:not(.externalLink) { etc.) is best if you need a link without a popup window, as it's the shortest route to cater for every external link on a website.

bob2517 commented 7 months ago

Closing pending release.