-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML and CSS cleaning #17
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution,
there are a few minor changes requested as review comment down below to make it great
Once accepted, we might reuse some of those file not only for divs_html_elements
test but also others.
You might wanna move some folders :
styles/
so it becomestests/styles/
scripts/awesome-doc-configuration.js
so it becomes `tests/scripts/awesome-doc_default-configuration.js
and then, for reusability purpose, refactorhttps://github.com/GuillaumeDua/awesome-doc-code-sections/blob/ce4493eadb3d899e209f550a2acf8fb424d51f59/tests/per_usage/custom_html_elements/index.html so it also gets benefits from it.
@@ -0,0 +1,26 @@ | |||
let is_stylished = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather name that file "style-mutators" rather than "styling", so the purpose is explicit
} | ||
|
||
let is_small = false; | ||
function toggle_small() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toggle_small
-> toggle_small_style
Right now, this function only works if toggle_style
was called before.
An improvement here would be to add a simple if-then here, such as :
if (!is_stylished)
toggle_style()
and modify toggle_style
so when L7 it removes the classes, then it also reset sizes
L7 :
function (elements) {
elements.removeClass(`${stylished_classname}`);
if (is_small)
toggle_small()
}
I moved scripts into a separated folder "scripts", same for "styles" for CSS styles and restructured the HTML :