-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add group variation for full block link #833
Conversation
5eed377
to
34921b5
Compare
/unhold d3e098b6-b0c6-4486-9e10-fe102f6b8dcf
Test instance is ready 🚀🌑 phoebe | admin | blocks report | CircleCI | composer-local.json ⌚ 2022.05.24 12:11:23 |
1d97278
to
5e3adca
Compare
/unhold 17c84291-0051-476a-98e3-c3e40a34f8f9
/unhold d3eaa399-f9f4-4c85-aa77-b914b2cdf781
416144b
to
075cc66
Compare
/unhold 5ee696f2-e55d-4259-a57a-5ab99c6e2d6b
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.
Looks like it will also be an issue for PDF links |
/unhold 6d228352-2e08-4b51-81a9-83f7417c001a
I made it use However neither of them look particularly well inside of the block on the example page (though they might in others). Could make sense to disable these styles on links that are expanded? I guess we can also follow up on this once somebody starts using a external/pdf link. |
I agree that it makes sense to remove them in this case, since we already don't show them in headings for example. 🤔 Ideally we would check that before adding the classes in JS, but that can be done in a follow-up! |
Well it's still accurate, but maybe it doesn't look that great in some cases. Let's get back to it once we get more feedback? |
In fact, ideally we wouldn't even be doing this in JS, but server side. Doing it in JS gives the browser more work and causes re-rendering during page load. Your point still stands, though, we should just not add the external links class when we don't need it 👍 |
46efd62
to
1967ee3
Compare
/unhold 104cd0d5-0c69-4313-b57e-70855394e27b
/unhold 9c8f69c7-8591-46bf-a824-79035d71401e
/unhold 9fce4c48-d0df-4d9c-9765-e2475eae0f2e
/unhold fae1902b-35f7-4772-9989-af96fd770520
/unhold 18ee1b4e-ef37-4981-8225-05b45c20ac1c
/unhold bcd75b4f-f2e6-40ab-9fae-d4f6d69dc748
/unhold 7e035eb3-f593-4d8b-8c47-ab524c424c85
It is added as a variation of the Group block, so it's used as such. In the example I've added a Columns block and within each column I've added an Also, Houssam spotted this Bootstrap functionality which does exactly what we want, maybe we could use that instead of adding custom CSS, but I don't see how to do it without JS so maybe it's not better 🤔 |
/unhold 9594d556-d42c-4596-b8d1-025ab30e1e40
/unhold 33279bb4-b3b7-4ad0-b8c9-274a5f486cf5
/unhold c1748b4a-28a7-4080-8a92-2fc4815c0b8c
@lithrel the only way I found to "revert" the variation is by removing the corresponding CSS class from the |
/unhold a4e49549-7ceb-4d2e-bed4-1af9ae91f82c
/unhold 85142ac8-50fd-4795-ae54-c73fd7631dd0
/unhold a2b7d045-c9b4-4ede-8f85-81a6cf372868
/unhold e4c2f3f5-f9d8-4d6a-86d4-10036b0a2edb
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 first link inside the block and expand it to full width/height * Give separate editor styles: a dashed border round the block to show the clickable area. * Prevent conflict with pdf and external link styles, by using :before instead of :after.
/unhold 1a9407a8-98c0-477c-aae8-3f23cc596bb8
Description
This should work well on any block that can use
position: relative
, and as long as the link is not within a block withposition: relative
inside the container.A drawback about this method is a block can only have 1 block style at a time. I have another PR that uses block styles to add padding on the same blocks. The only way to use styles for more things is to add 1 style for every possible combination. For more than 2 things that would probably get out of hand.A possible alternative is to create a variation of the core group block, similar to the new "row" block, which has this CSS. That would make it much more obvious what's happening than a style. That also frees up the block styles for actual styles.
I ended up using a variation because styles are already used for padding and equally spacing inside groups. A nice plus of the variation is that it shows up with the variation name, also in the block list.
Testing
Example: https://www-dev.greenpeace.org/test-phoebe/expanded-link-block/