What are the meanings of a mode name and .maker? |
What are the meanings of a mode name and .maker? |
bhs67 |
Apr 17 2024, 10:20 AM
Post
#1
|
Group: Members Posts: 6 Joined: 17-April 24 Member No.: 29,168 |
Segments of index.html:
CODE <body mode="maker"> ... <div class="maker"> Segments of index.css: CODE .maker { display: flex; flex-flow: column; justify-content: space-between; height: 460px; width: 400px; } .maker > div { display: flex; justify-content: space-between; } 1) It appears that CODE <body mode="maker"> is the code to assign the name "maker" to the <body>? And "mode" is the way to assign that name?2) It appears that CODE <div class="maker"> assigns that <div class> to the the <body> named "maker"?3) Does adding the "." to the name "maker" CODE .maker - tie this code to the body named "maker"?4) It's not clear to me the difference between CODE .maker {...} and CODE .maker > div {...} |
bhs67 |
Apr 23 2024, 08:56 AM
Post
#2
|
Group: Members Posts: 6 Joined: 17-April 24 Member No.: 29,168 |
I received this response from a Blockly forum:
---------------------------------------------------------------------- They are correct that "mode" is not a standard attribute. However, unless you are running your HTML through an HTML validator, this is unlikely to be a problem. It being nonstandard means the browser has no built-in reaction to the attribute being set, which is fine. CSS selectors that work on attributes will still work on non-standard attributes, which is the main thing we're doing with it here. If I were writing this app, I probably would have chosen a different approach, but I don't think there is anything wrong with the current one either. Using nonstandard attributes has become more common especially for popular frameworks like Angular and is now supported in custom elements. In the end, this is simply a quirk of the sample app that is used in the codelab. It is not actually related to the Blockly library at all, so you can either ignore it or you can change the app however you'd like to use a different approach to toggle between maker, edit, and blockly modes. ---------------------------------------------------------------------- |
Lo-Fi Version | Time is now: 8th June 2024 - 01:32 AM |