Skip to content

Commit 6205b3c

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 6205b3c

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

assets/css/activitypub-admin.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ 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+
122+
.activitypub-site-block-details td:last-child {
123+
width: 80px;
124+
}
125+
107126
.activitypub-settings-accordion {
108127
border: 1px solid #c3c4c7;
109128
}

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

Lines changed: 8 additions & 8 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,11 +447,11 @@ 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>
454-
<td style="width: 80px;">
454+
<td>
455455
<button type="button" class="button button-small remove-site-block-btn" data-type="domain" data-value="<?php echo \esc_attr( $domain ); ?>">
456456
<?php \esc_html_e( 'Remove', 'activitypub' ); ?>
457457
</button>
@@ -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,11 +495,11 @@ 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>
502-
<td style="width: 80px;">
502+
<td>
503503
<button type="button" class="button button-small remove-site-block-btn" data-type="keyword" data-value="<?php echo \esc_attr( $keyword ); ?>">
504504
<?php \esc_html_e( 'Remove', 'activitypub' ); ?>
505505
</button>

0 commit comments

Comments
 (0)