Conversation
Faq section designed
Thank you. A few things: In the pull request description please add a reference to the issue that the PR fixes: All texts need to use translation functions. Please see the documentation here: https://developer.wordpress.org/apis/internationalization/ The pattern needs to use a list block with a custom style, not paragraphs and HRs. |
Here is an example of how to add a custom style for the list block: |
Okay, Thank you for review. I am going to make it with list item with custom style. Here's a query for custom style, I f i add a register block style , may need to add css, then should i do that in style css file or what's the procedure actually. |
Add it to style.css for now. |
patterns/faq.php
Outdated
|
||
<!-- wp:group {"style":{"color":{"background":"#101010"},"spacing":{"padding":{"top":"8vh","bottom":"8vh","left":"6px","right":"6px"}}},"layout":{"type":"constrained"}} --> | ||
<div class="wp-block-group has-background" style="background-color:#101010;padding-top:8vh;padding-right:6px;padding-bottom:8vh;padding-left:6px"><!-- wp:heading {"style":{"elements":{"link":{"color":{"text":"var:preset|color|base-2"}}},"typography":{"fontSize":"10rem","letterSpacing":"-0.02em"}},"textColor":"base-2"} --> | ||
<h2 class="wp-block-heading has-base-2-color has-text-color has-link-color" style="font-size:10rem;letter-spacing:-0.02em">FAQs</h2> |
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.
Ready For Translation
patterns/faq.php
Outdated
<p class="has-base-2-color has-text-color has-link-color has-medium-font-size">↓ Can I apply to be a part of the team or work as a contractor?</p> | ||
<!-- /wp:paragraph --></div> | ||
<!-- /wp:group --></div> | ||
<!-- /wp:group --> |
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.
file must end with a newline
patterns/faq.php
Outdated
<!-- /wp:heading --> | ||
|
||
<!-- wp:group {"style":{"border":{"top":{"color":"#ffffff33","width":"1px"},"right":{"width":"0px","style":"none"},"bottom":{"color":"#ffffff33","width":"1px"},"left":{"width":"0px","style":"none"}},"spacing":{"padding":{"top":"15px","bottom":"15px"}}},"layout":{"type":"constrained"}} --> | ||
<div class="wp-block-group" style="border-top-color:#ffffff33;border-top-width:1px;border-right-style:none;border-right-width:0px;border-bottom-color:#ffffff33;border-bottom-width:1px;border-left-style:none;border-left-width:0px;padding-top:15px;padding-bottom:15px"><!-- wp:paragraph {"style":{"elements":{"link":{"color":{"text":"var:preset|color|base-2"}}},"layout":{"selfStretch":"fit","flexSize":null}},"textColor":"base-2","fontSize":"medium"} --> |
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.
use contrast-3 for all border color
patterns/faq.php
Outdated
|
||
?> | ||
|
||
<!-- wp:group {"style":{"color":{"background":"#101010"},"spacing":{"padding":{"top":"8vh","bottom":"8vh","left":"6px","right":"6px"}}},"layout":{"type":"constrained"}} --> |
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.
use align: full width and background-color: contrast
patterns/faq.php
Outdated
|
||
<!-- wp:group {"style":{"border":{"top":{"color":"#ffffff33","width":"1px"},"right":{"width":"0px","style":"none"},"bottom":{"color":"#ffffff33","width":"1px"},"left":{"width":"0px","style":"none"}},"spacing":{"padding":{"top":"15px","bottom":"15px"}}},"layout":{"type":"constrained"}} --> | ||
<div class="wp-block-group" style="border-top-color:#ffffff33;border-top-width:1px;border-right-style:none;border-right-width:0px;border-bottom-color:#ffffff33;border-bottom-width:1px;border-left-style:none;border-left-width:0px;padding-top:15px;padding-bottom:15px"><!-- wp:paragraph {"style":{"elements":{"link":{"color":{"text":"var:preset|color|base-2"}}},"layout":{"selfStretch":"fit","flexSize":null}},"textColor":"base-2","fontSize":"medium"} --> | ||
<p class="has-base-2-color has-text-color has-link-color has-medium-font-size">↓ What is your process working in smaller projects?</p> |
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.
Prepare all content for translation
@huzaifaalmesbah Thank you for reviewing. I am going to do the needful changes and will removed the category also. Will submit asap. |
Added custom block style in function , custom css and the main faq file with list block
Have translable all the hard coded string text and also changed the css file for list item
hi , @carolinan , sorry to bother you . Can you please guide me. My PHP code is getting failed all time for indention issue. Kinda lost in somewhere. I have used tab as indention still getting error. |
hope indention work fine
Thanks for the contribution @esrat71! One way to check what's going wrong with the code quality issues, is by checking the results of the failed test for the PR. You can also click on the Files Changed tab for the PR to see the fails in their respective lines. Another way could be running the test in your local environment. You can do that by running:
You can find more information about testing on the project's readme. I also recommend you check how to use the translation functions in the context of patterns. You could probably check the conversation that took place yesterday in Slack to get more context on when to use |
Thank you. I am again going to check if i can resolve the issue |
patterns/faq.php
Outdated
<div class="wp-block-group has-contrast-background-color has-background" style="padding-top:8vh;padding-right:6px;padding-bottom:8vh;padding-left:6px"><!-- wp:heading {"style":{"elements":{"link":{"color":{"text":"var:preset|color|base-2"}}},"typography":{"fontSize":"10rem","letterSpacing":"-0.02em"}},"textColor":"base-2"} --> | ||
<h2 class="wp-block-heading has-base-2-color has-text-color has-link-color" style="font-size:10rem;letter-spacing:-0.02em">FAQs</h2> | ||
<div class="wp-block-group has-contrast-background-color has-background" style="padding-top:8vh;padding-right:6px;padding-bottom:8vh;padding-left:6px"><!-- wp:heading {"style":{"elements":{"link":{"color":{"text":"var:preset|color|base-2"}}},"typography":{"fontSize":"10rem","letterSpacing":"-0.02em"}},"textColor":"base-2"} --> | ||
<h2 class="wp-block-heading has-base-2-color has-text-color has-link-color" style="font-size:10rem;letter-spacing:-0.02em"<?php echo esc_html__( 'FAQs?', 'twentytwentyfour' ); ?>></h2> |
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.
Please look carefully, this code is missing a closing tag and is broken.
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.
okay , checking again . Thank you
have checked again , added all translable strings..
added and removed space after watching following brackets
style.css
Outdated
.is-style-faq-check-lists li::before { | ||
content: "\2193"; | ||
position: absolute; | ||
left: 0; |
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.
Thank you so much for working on this. My main concern about this solution are RTL languages. In those cases we want the checkmark to be positioned to the right instead. This is the only official docs I found on RTL. It looks like we are going to need an extra stylesheet just for this. Do you know a better way @carolinan?
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.
Another option could be using the .rtl class that's automatically added to the body for RTL languages (if the idea is to avoid having a separate stylesheet).
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 recently tried to use the .rtl class in a Gutenberg block and found that it is not used in the iframed block editor(!)
The editor uses <html dir="rtl">
and we can not target children of elements with this attribute.
See https://developer.mozilla.org/en-US/docs/Web/CSS/:dir
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.
Should we perhaps try to fix it in Gutenberg? WordPress/gutenberg#51480
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 am not sure we have enough time.
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.
Should i try to use in different way without children ? like as just user can copy the icon and list item will as normal list item .
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.
Then User will have to icon like this and space between the item like the example https://prnt.sc/YnphTJPkKVnD What do you think ? as some of section in white background using this type pattern
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.
and one more thing, i tried to using marker and list style image, if i use list-style-position as normal , the list item border is not working as expected we want in design https://prnt.sc/avLaO4fbHqyR
I've made a few changes to this PR, the main one being that I changed the list block with the details block, so now we have the functionality of showing/hidding text for each FAQ item. I think this pattern is perfect to showcase this recently added block. Let's follow up with improvements and add some sample text to each of the FAQ items text. @beafialho can you provide some sample text for these, please? |
Absolutely, I have also imagined this to use the details block. Here's some sample text, it can be used for all of the questions:
|
Faq section designed
Description
faq section designed as pattern
Reference to the issue that the PR fixes:
#119
Screenshots
https://prnt.sc/CDb7GJTljavD
Testing Instructions
Another way