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

code review #4

Closed
wants to merge 36 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
342f5b1
initial commit
ptesei Mar 30, 2024
56c0fe2
feat menu dropdown
ptesei Mar 30, 2024
24a2bba
enable interactivity build
ptesei Mar 30, 2024
3c87c06
viewscript as module
ptesei Mar 30, 2024
6292122
add body styles
ptesei Mar 30, 2024
3992087
add banner and doc
ptesei Apr 5, 2024
6692837
rebuild
ptesei Apr 5, 2024
12fce46
add screeshots
ptesei Apr 5, 2024
b980ef9
add readme and licence
ptesei Apr 6, 2024
d7401a3
refactor wordpress org
ptesei Apr 6, 2024
7ec16a7
add screenshots
ptesei Apr 6, 2024
91b3160
add code quality tools
ptesei Apr 6, 2024
350a1a4
feat update build
ptesei Apr 6, 2024
e9619f5
fix coding standard
ptesei Apr 6, 2024
e317a0e
update php version
ptesei Apr 6, 2024
c12fff7
update node version
ptesei Apr 6, 2024
e25e447
Merge pull request #2 from mosne/develop
ptesei Apr 6, 2024
34c4d51
add comments
ptesei Apr 7, 2024
ec7edc7
Merge pull request #3 from mosne/develop
ptesei Apr 7, 2024
212f396
update text
ptesei Apr 7, 2024
e76aaea
fix path
ptesei Apr 7, 2024
9c3428a
update test
ptesei Apr 7, 2024
ba432d5
Merge pull request #5 from mosne/develop
ptesei Apr 7, 2024
9cfe58b
fix banner
ptesei Apr 7, 2024
9f415d7
Merge branch 'develop'
ptesei Apr 7, 2024
030c809
fixed readme
ptesei Apr 10, 2024
7e90ec8
add esc attr and direc access avoidance
ptesei May 12, 2024
47817d3
fix the fix
ptesei May 30, 2024
cbffd49
Merge pull request #6 from mosne/fix-evaluations
ptesei May 30, 2024
b40aa9e
fix cs
ptesei May 30, 2024
e3198fe
bump version 0.1.1
ptesei May 30, 2024
4bed6cb
update
ptesei May 30, 2024
bb6bebd
fix cs
ptesei May 31, 2024
732e1cf
Merge pull request #7 from mosne/fix-evaluations
ptesei May 31, 2024
0fe4df0
update release git flow
ptesei Jun 1, 2024
96eef57
Merge pull request #9 from mosne/ver/0.1.1
ptesei Jun 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add banner and doc
ptesei committed Apr 6, 2024
commit 39920872512ba576968b2b6cdea28c4499860d9a
Binary file modified _wordpress/banner1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _wordpress/banner772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _wordpress/icon128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _wordpress/icon256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion build/mosne-dark-palette/block.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"apiVersion": 3,
"name": "mosne/dark-palette",
"version": "0.1.0",
"title": "Mosne Dark Palette",
"title": "Dark Palette switcher",
"category": "widgets",
"description": "Create and apply your dark palette in an a11y friendly way using the new Interactivity API.",
"parent": [
1 change: 1 addition & 0 deletions build/mosne-dark-palette/index.css.map

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

1 change: 1 addition & 0 deletions build/mosne-dark-palette/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/mosne-dark-palette/style-index.css

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

1 change: 1 addition & 0 deletions build/mosne-dark-palette/style-index.css.map

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

1 change: 1 addition & 0 deletions build/mosne-dark-palette/view.js.map
23 changes: 15 additions & 8 deletions languages/mosne-dark-palette.pot
Original file line number Diff line number Diff line change
@@ -2,20 +2,22 @@
# This file is distributed under the GPL-2.0-or-later.
msgid ""
msgstr ""
"Project-Id-Version: Mosne Dark Palette 0.1.0\n"
"Project-Id-Version: Dark Palette 0.1.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mosne-dark-palette\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-04-04T15:07:01+00:00\n"
"POT-Creation-Date: 2024-04-05T12:23:13+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.10.0\n"
"X-Domain: mosne-dark-palette\n"

#. Plugin Name of the plugin
msgid "Mosne Dark Palette"
#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:150
msgid "Dark Palette"
msgstr ""

#. Description of the plugin
@@ -27,48 +29,53 @@ msgid "The WordPress Contributors"
msgstr ""

#: build/mosne-dark-palette/index.js:1
msgid "Dark Palette"
msgstr ""

#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:239
msgid "Settings"
msgstr ""

#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:248
msgid "Options"
msgstr ""

#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:254
msgid "Icon"
msgstr ""

#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:258
msgid "Label"
msgstr ""

#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:262
msgid "Both"
msgstr ""

#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:268
msgid "Default label"
msgstr ""

#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:278
msgid "OS auto label"
msgstr ""

#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:288
msgid "Dark label"
msgstr ""

#: build/mosne-dark-palette/index.js:1
#: build/mosne-dark-palette/index.js:295
msgid "Light label"
msgstr ""

#: build/mosne-dark-palette/block.json
msgctxt "block title"
msgid "Mosne Dark Palette"
msgid "Dark Palette switcher"
msgstr ""

#: build/mosne-dark-palette/block.json
7 changes: 4 additions & 3 deletions mosne-dark-palette.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php
/**
* Plugin Name: Mosne Dark Palette
* Plugin Name: Dark Palette
* Description: Create and apply your dark palette in an a11y friendly way using the new Interactivity API.
* Requires at least: 6.5
* Requires PHP: 7.4
* Version: 0.1.0
* Author: The WordPress Contributors
* Author: Mosne
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* author URI: https://mosne.it
* Text Domain: mosne-dark-palette
*
* @package create-block
@@ -53,6 +54,6 @@ function mosne_dark_palette_head_script(): void {
$dark_mode_script_handle = 'mosne-dark-palette';
wp_register_script( $dark_mode_script_handle, false, array(), false, array( 'in_footer' => false ) );
wp_add_inline_script( $dark_mode_script_handle, $dark_mode_script );
wp_enqueue_script( $dark_mode_script_handle );
//wp_enqueue_script( $dark_mode_script_handle );
}

83 changes: 54 additions & 29 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,56 +1,81 @@
=== Mosne Dark Palette ===
Contributors: mosne
Tags: block
Tags: block, palette, dark, color, accessibility, a11y, interactivity
Tested up to: 6.5
Stable tag: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Mosne Dark Palette

== Description ==

Create and apply your dark palette in an a11y friendly way using the new Interactivity API.
Child of the block navigation menu, Mosne Dark Palette is gutenberg block that gives you :
- A dropdown to choose the color mode you want with custom labels
- A color picker to remap you color palette

== Installation ==
== Description ==

This section describes how to install the plugin and get it working.
Add the Mosne Dark Palette block in a block navigation.
Child of the block navigation menu, Mosne Dark Palette is gutenberg block that gives you :
* A dropdown switcher to choose the color mode you want with custom labels
* A color picker to remap you color palette

e.g.
=== Key Features ===

1. Upload the plugin files to the `/wp-content/plugins/mosne-dark-palette` directory, or install the plugin through the WordPress plugins screen directly.
1. Activate the plugin through the 'Plugins' screen in WordPress
* Dark palette block for the block navigation menu
* Use all your custom colors and custom labels
* Accessibility ready
* No cookies are used (GDPR friendly)
* Performance optimized, very lightweight
* No block library required
* Built almost entirely with native WordPress components
* Developer friendly, easy to customize

=== Stay Connected ===

== Frequently Asked Questions ==
* [View on GitHub](https://github.com/mosne/mosne-dark-palette)
* [Visit my website](https://mosne.it/)
* [Follow on Twitter](https://twitter.com/mosne)

= A question that someone might have =
== Installation ==

An answer to that question.
1. You have a couple of options:
* Go to Plugins &rarr; Add New and search for "Dark Palette". Once found, click "Install".
* Download the Dark Palette from wordpress.org and make sure the folder is zipped. Then upload via Plugins &rarr; Add New &rarr; Upload.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Search for the block within the Block Editor (Gutenberg) and add the "Dark Palette Switcher" block in a block navigation menu.

= What about foo bar? =
== Frequently Asked Questions ==

Answer to foo bar dilemma.
= How can i customize my css? =

you can change the desired behviour using CSS in your theme or in the customizer.
``` css
body[data-theme="dark"] {
/* your CSS here */
}
```
= Where can I add custom colors =
You can go in the style editor (Apparence > Editor > Styles) and add color to your custom palette.

= Where can I change the icons? =

you can change the icons using CSS in your theme or in the customizer.
``` css
.wp-block-mosne-dark-palette.has-icon button.has-icon {
mask: url("[your svg path]") no-repeat;
}
.wp-block-mosne-dark-palette.has-icon button.has-icon--dark {
mask: url("[your svg path]") no-repeat;
}
.wp-block-mosne-dark-palette.has-icon button.has-icon--light {
mask: url("[your svg path]") no-repeat;
}
```

== Screenshots ==

1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
(or jpg, jpeg, gif).
2. This is the second screen shot
1.
2.

== Changelog ==

= 0.1.0 =
* Release

== Arbitrary section ==
= 0.1.0 - 2023-04-04 =

You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
"installation." Arbitrary sections will be shown below the built-in sections outlined above.
* Initial release
2 changes: 1 addition & 1 deletion src/mosne-dark-palette/block.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"apiVersion": 3,
"name": "mosne/dark-palette",
"version": "0.1.0",
"title": "Mosne Dark Palette",
"title": "Dark Palette switcher",
"category": "widgets",
"description": "Create and apply your dark palette in an a11y friendly way using the new Interactivity API.",
"parent": [ "core/navigation" ],
14 changes: 4 additions & 10 deletions src/mosne-dark-palette/style.scss
Original file line number Diff line number Diff line change
@@ -16,16 +16,14 @@
appearance: none;
padding: 0;
border: 0;
font-family: inherit;
font-size: inherit;
font-weight: inherit;
font: inherit;
color: inherit;
background-color: inherit;
background: inherit;
line-height: inherit;
cursor: pointer;
white-space: nowrap;

&:hover {
&:hover span {
text-decoration: underline;
}
}
@@ -75,11 +73,8 @@

&.hide-label {
// sr-only
> button,
.has-child > button {
&:hover,
&:focus {
text-decoration: none;
}

> span {
width: 1px;
@@ -91,7 +86,6 @@
white-space: nowrap;
border-width: 0;
display: inline-block;

}

&::before {