by Zephyr » Sat Apr 29, 2017 10:20 am
Ernie,
Thanks for the info. While It's not common practice, it is allowed to place `<style>` tags inside the body of an HTML document, so that's why the above works.
NOTE: A style element should preferably be used in the head of the document. The use of style in the body of the document may cause restyling, trigger layout and/or cause repainting, and hence, should be used with care.
http://w3c.github.io/html/document-metadata.html#the-style-elementAt the risk of insulting your intelligence, I offer the following observations.
It seems that FCD is designed where each side of each card is a complete HTML page rendered by the in-app fully featured Safari/iOS browser, and you're defining app level styles already. You can define multiple CSS styles in the header, and the browser combines each rule in a parent-child relationship, and then applies them in sequential descending order with the last defined style for each element or class determining the way the browser actually displays that content.
So, you could on a deck or app level, create a place where the user can define styles (or anything else) and have that code "injected" as the last item in the header of each side of each card.
- Code: Select all
<html>
<head>
<!-- All current app/deck level stuff here -->
<!-- User defined styles injected here as last item -->
<style type="text/css"></style>
</head>
<body>
<!-- card content -->
</body>
</html>
You could even have that be a separately defined/imported document like pictures and audio work. This would make it tremendously easy to create (and modify) highly customizable cards. By leveraging the features of the full browser, you could, in theory, do anything on a card with styles which you could do in a full browser.
Aside, this is actually how I create my decks. I use a small code editing application called BBEdit which allows me to see the HTML and styles color coded, and a live preview of the card as I type. I then copy each side of the card into an excel sheet and import through dropbox. Multilayered, and a bit cumbersome, but it works, and has allowed the creation and mass reproduction of complex and highly styled cards.
Ernie,
Thanks for the info. While It's not common practice, it is allowed to place `<style>` tags inside the body of an HTML document, so that's why the above works.
[quote]NOTE: A style element should preferably be used in the head of the document. The use of style in the body of the document may cause restyling, trigger layout and/or cause repainting, and hence, should be used with care.[/quote]
[url]http://w3c.github.io/html/document-metadata.html#the-style-element[/url]
At the risk of insulting your intelligence, I offer the following observations.
It seems that FCD is designed where each side of each card is a complete HTML page rendered by the in-app fully featured Safari/iOS browser, and you're defining app level styles already. You can define multiple CSS styles in the header, and the browser combines each rule in a parent-child relationship, and then applies them in sequential descending order with the last defined style for each element or class determining the way the browser actually displays that content.
So, you could on a deck or app level, create a place where the user can define styles (or anything else) and have that code "injected" as the last item in the header of each side of each card.
[code]
<html>
<head>
<!-- All current app/deck level stuff here -->
<!-- User defined styles injected here as last item -->
<style type="text/css"></style>
</head>
<body>
<!-- card content -->
</body>
</html>[/code]
You could even have that be a separately defined/imported document like pictures and audio work. This would make it tremendously easy to create (and modify) highly customizable cards. By leveraging the features of the full browser, you could, in theory, do anything on a card with styles which you could do in a full browser.
Aside, this is actually how I create my decks. I use a small code editing application called BBEdit which allows me to see the HTML and styles color coded, and a live preview of the card as I type. I then copy each side of the card into an excel sheet and import through dropbox. Multilayered, and a bit cumbersome, but it works, and has allowed the creation and mass reproduction of complex and highly styled cards.