Skip to content
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

Dc sb alert #185

Open
wants to merge 13 commits into
base: sandbox
Choose a base branch
from
Open

Dc sb alert #185

wants to merge 13 commits into from

Conversation

sbagg
Copy link
Contributor

@sbagg sbagg commented Jul 26, 2022

No description provided.

@sbagg sbagg requested review from wrenaria and spelkey-ucd July 26, 2022 22:22
@sbagg
Copy link
Contributor Author

sbagg commented Jul 26, 2022

This is for the alert text box

@spelkey-ucd
Copy link
Member

Use the richtext component instead of innerblocks

@@ -20,7 +20,8 @@ function __construct($editor_script_slug, $settings=array()) {

$this->iconsUsed = [
'ucd-public:fa-star',
'ucd-public:fa-circle-chevron-right'
'ucd-public:fa-circle-chevron-right',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding it this way, will load the icon on every single page even if the block isn't used.

Instead, create a block transformation where you set the icon attribute to ucd-public:fa-circle-exclamation

const { attributes, setAttributes } = props;
const blockProps = useBlockProps();

const mainEleProps = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete if not used

@@ -0,0 +1,8 @@
import { html } from "../../utils";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of innerblocks, use richtext component and save text as an attribute

@@ -276,6 +276,9 @@ const template = html`
<g id="fa-fill" viewBox="0 0 512 512">
<path d="M502.63 217.06L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.77c-6.24-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.63l86.19 86.18-94.76 94.76c-37.49 37.49-37.49 98.26 0 135.75l117.19 117.19c18.75 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.88-28.12l221.57-221.57c12.49-12.5 12.49-32.76 0-45.26zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.61 58.6c12.49 12.49 32.75 12.49 45.24 0 12.49-12.49 12.49-32.75 0-45.24l-58.61-58.6 58.95-58.95 162.45 162.44-48.35 48.34z"/>
</g>
<g id="fa-circle-exclamation" viewBox="0 0 512 512">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. this is a dynamically generated file. your change will be overwritten the next time the icon set is regenerated.
  2. This icon should already be loaded in the editor side, so no need to add it.

@@ -350,6 +350,27 @@ hr.dotted {
border-top: 4px dotted;
}

.alertIcon {
color:red;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use brand colors

.alertdiv {
background-color: #FFFFFF;
padding:5px;
color: red;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use brand colors


}
.divAlertContent {
display:inline-block;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use flex! soooo much easier to align....

font-weight: bold;
}
.alertdiv {
background-color: #FFFFFF;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inherit the background color. kimmy frequently uses lightly shaded sections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants