Browse Source

Changements styles filtres

Utilisation d'une coche plutôt qu'un changement de couleur.
Meilleure accessibilité avec ARIA.
Optimisation des sélecteurs CSS.
En particulier, évite les sélecteurs universels * qui sont très couteux
en performances.
https://github.com/marienfressinaud/FreshRSS/issues/277
https://github.com/marienfressinaud/FreshRSS/pull/357
Alexandre Alapetite 12 years ago
parent
commit
bddbe5f79f

+ 6 - 6
app/layout/nav_menu.phtml

@@ -132,7 +132,7 @@
 				$url_state = $url;
 				$url_state['params']['state'] = 'all';
 			?>
-			<li class="item <?php if ($this->state == 'all') echo "selected"?>">
+			<li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'all') ? 'true' :'false'; ?>">
 				<a class="print_all" href="<?php echo Minz_Url::display ($url_state); ?>">
 					<?php echo Minz_Translate::t ('show_all_articles'); ?>
 				</a>
@@ -140,23 +140,23 @@
 			<?php
 				$url_state['params']['state'] = 'not_read';
 			?>
-			<li class="item <?php if ($this->state == 'not_read') echo "selected"?>">
+			<li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'not_read') ? 'true' :'false'; ?>">
 				<a class="print_non_read" href="<?php echo Minz_Url::display ($url_state); ?>">
 					<?php echo Minz_Translate::t ('show_not_reads'); ?>
 				</a>
 			</li>
 			<?php
-					$url_state['params']['state'] = 'read';
+				$url_state['params']['state'] = 'read';
 			?>
-			<li class="item <?php if ($this->state == 'read') echo "selected"?>">
+			<li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'read') ? 'true' :'false'; ?>">
 				<a class="print_read" href="<?php echo Minz_Url::display ($url_state); ?>">
 					<?php echo Minz_Translate::t ('show_read'); ?>
 				</a>
 			</li>
 			<?php
-					$url_state['params']['state'] = 'favorite';
+				$url_state['params']['state'] = 'favorite';
 			?>
-			<li class="item <?php if ($this->state == 'favorite') echo "selected"?>">
+			<li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'favorite') ? 'true' :'false'; ?>">
 				<a class="print_favorite" href="<?php echo Minz_Url::display ($url_state); ?>">
 					<?php echo Minz_Translate::t ('show_favorite'); ?>
 				</a>

+ 10 - 10
p/themes/default/global.css

@@ -392,28 +392,28 @@ input, select, textarea {
 			font-size: 14px;
 			line-height: 30px;
 		}
-		.dropdown-menu .item {
+		.dropdown-menu > .item {
 			display: block;
 			height: 30px;
 			font-size: 90%;
 			line-height: 30px;
 		}
-		.dropdown-menu .item.selected{
-			background: #0062be;
-		}
-		.dropdown-menu .item.selected a{
-			color: #fff;
-		}
-			.dropdown-menu .item > * {
+			.dropdown-menu > .item > a {
 				display: block;
 				padding: 0 25px;
 				line-height: 30px;
 			}
-			.dropdown-menu .item:hover {
+			.dropdown-menu > .item:hover {
 				background: #0062BE;
 				color: #fff;
 			}
-				.dropdown-menu .item:hover > * {
+				.dropdown-menu > .item[aria-checked="true"] > a:before {
+					content: '✓ ';
+					font-weight: bold;
+					margin: 0 0 0 -1.2em;
+					padding: 0 0.2em 0 0;
+				}
+				.dropdown-menu > .item:hover > a {
 					color: #fff;
 					text-decoration: none;
 				}

+ 9 - 9
p/themes/default_dark/global.css

@@ -386,22 +386,22 @@ input, select, textarea {
 			font-size: 90%;
 			line-height: 30px;
 		}
-		.dropdown-menu .item.selected{
-			background: #26303f;
-		}
-		.dropdown-menu .item.selected a{
-			color: #888;
-		}
-			.dropdown-menu .item > * {
+			.dropdown-menu > .item > a {
 				display: block;
 				padding: 0 25px;
 				line-height: 30px;
 			}
-			.dropdown-menu .item:hover {
+			.dropdown-menu > .item:hover {
 				background: #26303F;
 				color: #888;
 			}
-				.dropdown-menu .item:hover > * {
+				.dropdown-menu > .item[aria-checked="true"] > a:before {
+					content: '✓ ';
+					font-weight: bold;
+					margin: 0 0 0 -1.2em;
+					padding: 0 0.2em 0 0;
+				}
+				.dropdown-menu > .item:hover > a {
 					color: #888;
 					text-decoration: none;
 				}

+ 10 - 11
p/themes/flat-design/global.css

@@ -381,29 +381,28 @@ input, select, textarea {
 			font-size: 14px;
 			line-height: 30px;
 		}
-		.dropdown-menu .item {
+		.dropdown-menu > .item {
 			display: block;
 			height: 30px;
 			font-size: 90%;
 			line-height: 30px;
 		}
-		.dropdown-menu .item.selected{
-			background: #2980b9;
-		}
-		.dropdown-menu .item.selected a{
-			background: #2980b9;
-			color: #fff;
-		}
-			.dropdown-menu .item > * {
+			.dropdown-menu > .item > a {
 				display: block;
 				padding: 0 25px;
 				line-height: 30px;
 			}
-			.dropdown-menu .item:hover {
+			.dropdown-menu > .item:hover > a {
 				background: #2980b9;
 				color: #fff;
 			}
-				.dropdown-menu .item:hover > * {
+				.dropdown-menu > .item[aria-checked="true"] > a:before {
+					content: '✓ ';
+					font-weight: bold;
+					margin: 0 0 0 -1.2em;
+					padding: 0 0.2em 0 0;
+				}
+				.dropdown-menu > .item:hover > a {
 					color: #fff;
 					text-decoration: none;
 				}