Skip to content

Commit

Permalink
Feature/styles (#37)
Browse files Browse the repository at this point in the history
* change: editor error and warning styles

* finish: styles

* upgrade: package lock
  • Loading branch information
troychaplin authored Sep 15, 2024
1 parent 19178f3 commit bdf7a4d
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 136 deletions.
26 changes: 19 additions & 7 deletions Functions/SettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,29 @@ public function settingsPageLayout()
echo '<h1>' . esc_html(get_admin_page_title()) . '</h1>' . "\n";
echo '<form class="block-a11y-checks-settings-form" action="options.php" method="post">' . "\n";

echo '<div class="block-a11y-checks-settings-options">';
echo '<div class="block-a11y-checks-settings-grid">';

// Output the settings fields manually to avoid the table layout
settings_fields('block_checks_settings_group');
do_settings_sections('block_checks_options');
submit_button();
echo '</div>';

echo '<div class="block-a11y-checks-settings-info">';
echo '<h2>' . esc_html__('About', 'block-accessibility-checks') . '</h2>';
echo '<p>' . esc_html__('This plugin checks the accessibility of the core blocks in the WordPress block editor. You can set the level of strictness for each block type.', 'block-accessibility-checks') . '</p>';
// Retrieve all the fields added dynamically in initSettings()
$blockConfig = BlockConfig::getInstance()->getBlockConfig();
$options = get_option('block_checks_options');

// Loop through each field and wrap in a custom div
foreach ($blockConfig as $block) {
$value = isset($options[$block['option_name']]) ? $options[$block['option_name']] : 'error';
$dynamicClass = esc_attr($value);

echo '<div class="block-a11y-checks-settings-field block-a11y-checks-settings-field--' . $dynamicClass . '">';
echo '<h2>' . esc_html($block['block_label']) . '</h2>';
call_user_func(array($this, $block['function_name']));
echo '</div>';
}

echo '</div>';

submit_button();
echo '</form>' . "\n";
echo '</div>' . "\n";
}
Expand Down
2 changes: 1 addition & 1 deletion build/block-admin-rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/block-admin.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '9a0d563b6fd72d0d2a83');
<?php return array('dependencies' => array(), 'version' => '8bf204609efefb27025d');
2 changes: 1 addition & 1 deletion build/block-admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/block-checks-rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/block-checks.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => 'a8ef3cd57d13f1ba602f');
<?php return array('dependencies' => array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => 'b408ac5230f941007a5c');
2 changes: 1 addition & 1 deletion build/block-checks.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 51 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions src/styles/error.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@
flex-direction: column;
gap: 18px;
width: 100%;
padding: 20px 24px;
margin-left: -24px;
padding: 50px;
margin-left: -50px;
background-color: #f7edec;
border: 3px dashed #8b3122;
border: 1px dashed #8b3122;
border-radius: 5px;
overflow: hidden;
}

.a11y-error-msg {
/* display: flex;
gap: 6px;
align-items: center; */
font-size: 16px;
line-height: 24px;
font-weight: 600;
text-align: center;
color: white;
background-color: #8b3122;
padding: 5px 10px;
border-radius: 5px;
padding: 15px 20px;
margin: -40px -40px 30px -40px;
}

/* Remove top spacing from block being wrapped */
Expand Down
Loading

0 comments on commit bdf7a4d

Please sign in to comment.