diff --git a/CHANGELOG.md b/CHANGELOG.md index f1aee7c..a82ddc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.1] - 2026-01-09 + +### Added + +- New minimal-style CSS for shortcode form with gray input and black button + +### Changed + +- Shortcode form now automatically enqueues its own stylesheet + ## [1.3.0] - 2026-01-08 ### Added diff --git a/assets/css/shortcode-form.css b/assets/css/shortcode-form.css new file mode 100644 index 0000000..f4d521e --- /dev/null +++ b/assets/css/shortcode-form.css @@ -0,0 +1,122 @@ +/** + * Shortcode form styles. + * + * Minimal design with gray input and black button. + * + * @package PassWP_Posts + */ + +.passwp-login { + max-width: 600px; + margin: 0 auto; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; +} + +.passwp-login .loginform { + margin: 0; + padding: 0; +} + +.passwp-login .login-password { + margin: 0 0 2px; + padding: 0; +} + +.passwp-login .login-password label { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} + +.passwp-login .login-password .input { + display: block; + width: 100%; + padding: 20px 24px; + margin: 0; + font-size: 16px; + font-weight: 600; + letter-spacing: 0.05em; + text-transform: uppercase; + color: #7a8a99; + background-color: #f2f2f2; + border: none; + box-sizing: border-box; + outline: none; +} + +.passwp-login .login-password .input::placeholder { + color: #7a8a99; + font-weight: 600; + letter-spacing: 0.05em; + text-transform: uppercase; +} + +.passwp-login .login-password .input:focus { + background-color: #e8e8e8; +} + +.passwp-login .login-remember { + margin: 16px 0; + padding: 0; + font-size: 14px; + color: #666; +} + +.passwp-login .login-remember label { + display: flex; + align-items: center; + gap: 8px; + cursor: pointer; +} + +.passwp-login .login-remember input[type="checkbox"] { + width: 18px; + height: 18px; + margin: 0; + cursor: pointer; +} + +.passwp-login .login-submit { + margin: 0; + padding: 0; +} + +.passwp-login .login-submit .button { + display: block; + width: 100%; + padding: 20px 24px; + margin: 0; + font-size: 16px; + font-weight: 500; + letter-spacing: 0.1em; + text-transform: uppercase; + text-align: center; + color: #ffffff; + background-color: #000000; + border: none; + cursor: pointer; + box-sizing: border-box; + transition: background-color 0.2s ease; +} + +.passwp-login .login-submit .button:hover, +.passwp-login .login-submit .button:focus { + background-color: #333333; +} + +/* Error message */ +.passwp-login p[role="alert"] { + margin: 0 0 16px; + padding: 12px 16px; + background-color: #fef2f2; + border: 1px solid #fecaca; + border-radius: 4px; + color: #dc2626; + font-size: 14px; +} \ No newline at end of file diff --git a/includes/Shortcodes.php b/includes/Shortcodes.php index 1063ddb..7826213 100644 --- a/includes/Shortcodes.php +++ b/includes/Shortcodes.php @@ -39,6 +39,14 @@ public function register_shortcodes(): void { * @param array|string $atts Shortcode attributes. */ public function render_passwp_login( array|string $atts = [] ): string { + // Enqueue shortcode form styles. + wp_enqueue_style( + 'passwp-posts-shortcode', + PASSWP_POSTS_URL . 'assets/css/shortcode-form.css', + [], + PASSWP_POSTS_VERSION + ); + $settings = get_option( 'passwp_posts_settings', [] ); if ( empty( $settings[ 'enabled' ] ) || empty( $settings[ 'password_hash' ] ) ) { diff --git a/package.json b/package.json index 55730e1..27b74cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "passwp-posts", - "version": "1.3.0", + "version": "1.3.1", "description": "Password protects all pages and posts except the front page", "type": "module", "scripts": { diff --git a/passwp-posts.php b/passwp-posts.php index 7d373a3..98c59f7 100644 --- a/passwp-posts.php +++ b/passwp-posts.php @@ -3,7 +3,7 @@ * Plugin Name: PassWP Posts * Plugin URI: https://developer.suspended.no/passwp-posts * Description: Password protects all pages and posts except the front page. Logged-in users bypass the password. - * Version: 1.3.0 + * Version: 1.3.1 * Author: Per Soderlind * Author URI: https://soderlind.no * License: GPL-2.0+ @@ -22,7 +22,7 @@ defined( 'ABSPATH' ) || exit; // Plugin constants. -define( 'PASSWP_POSTS_VERSION', '1.3.0' ); +define( 'PASSWP_POSTS_VERSION', '1.3.1' ); define( 'PASSWP_POSTS_PATH', plugin_dir_path( __FILE__ ) ); define( 'PASSWP_POSTS_URL', plugin_dir_url( __FILE__ ) ); define( 'PASSWP_POSTS_BASENAME', plugin_basename( __FILE__ ) ); diff --git a/readme.txt b/readme.txt index c7b0fb5..4271b90 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: password, protection, privacy, security, access control Requires at least: 6.8 Tested up to: 6.9 Requires PHP: 8.3 -Stable tag: 1.3.0 +Stable tag: 1.3.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 690dfb0..b7b165e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -200,6 +200,10 @@ protected function setup_common_stubs(): void { throw new \Exception( $message ); }, 'current_user_can' => '__return_true', + + // Asset functions. + 'wp_enqueue_style' => '__return_null', + 'wp_enqueue_script' => '__return_null', ) ); }