Skip to content

Commit 4d67dae

Browse files
committed
Move inline CSS to stylesheet for site block details
Move the inline styles for the collapsible details/summary elements to activitypub-admin.css instead of using inline styles in PHP.
1 parent 3d48477 commit 4d67dae

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

assets/css/activitypub-admin.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@ summary {
104104
color: #2271b1;
105105
}
106106

107+
.activitypub-site-block-details {
108+
margin: 10px 0;
109+
}
110+
111+
.activitypub-site-block-details summary {
112+
padding: 8px 0;
113+
color: inherit;
114+
text-decoration: none;
115+
}
116+
117+
.activitypub-site-block-details table {
118+
max-width: 500px;
119+
margin-top: 10px;
120+
}
121+
107122
.activitypub-settings-accordion {
108123
border: 1px solid #c3c4c7;
109124
}

includes/wp-admin/class-settings-fields.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ public static function render_site_blocked_domains_field() {
435435

436436
<div class="activitypub-site-block-list">
437437
<?php if ( ! empty( $blocked_domains ) ) : ?>
438-
<details style="margin: 10px 0;">
439-
<summary style="cursor: pointer; padding: 8px 0; color: inherit;">
438+
<details class="activitypub-site-block-details">
439+
<summary>
440440
<?php
441441
echo \esc_html(
442442
\sprintf(
@@ -447,7 +447,7 @@ public static function render_site_blocked_domains_field() {
447447
);
448448
?>
449449
</summary>
450-
<table class="widefat striped activitypub-site-blocked-domain" role="presentation" style="max-width: 500px; margin-top: 10px;">
450+
<table class="widefat striped activitypub-site-blocked-domain" role="presentation">
451451
<?php foreach ( $blocked_domains as $domain ) : ?>
452452
<tr>
453453
<td><?php echo \esc_html( $domain ); ?></td>
@@ -483,8 +483,8 @@ public static function render_site_blocked_keywords_field() {
483483

484484
<div class="activitypub-site-block-list">
485485
<?php if ( ! empty( $blocked_keywords ) ) : ?>
486-
<details style="margin: 10px 0;">
487-
<summary style="cursor: pointer; padding: 8px 0; color: inherit;">
486+
<details class="activitypub-site-block-details">
487+
<summary>
488488
<?php
489489
echo \esc_html(
490490
\sprintf(
@@ -495,7 +495,7 @@ public static function render_site_blocked_keywords_field() {
495495
);
496496
?>
497497
</summary>
498-
<table class="widefat striped activitypub-site-blocked-keyword" role="presentation" style="max-width: 500px; margin-top: 10px;">
498+
<table class="widefat striped activitypub-site-blocked-keyword" role="presentation">
499499
<?php foreach ( $blocked_keywords as $keyword ) : ?>
500500
<tr>
501501
<td><?php echo \esc_html( $keyword ); ?></td>

0 commit comments

Comments
 (0)