瀏覽代碼

Made tooltips enabled for disabled buttons by default. Moved restriction into the .ck-toolbar scope.

Aleksander Nowodzinski 9 年之前
父節點
當前提交
5a247662dc

+ 3 - 4
packages/ckeditor5-theme-lark/theme/components/button.scss

@@ -124,11 +124,10 @@ a.ck-button {
 		@include ck-tooltip_visible();
 	}
 
-	// 1. Get rid of the focus outline around the tooltip when focused (but not :hover).
-	// 2. Don't display tooltips for disabled buttons, they're unavailable anyway.
-	// 3. Don't display tooltips for buttons with text; text explains the button anyway.
+	// Tooltip tweaks:
+	//   1. Get rid of the focus outline around the tooltip when focused (but not :hover).
+	//   2. Don't display tooltips for buttons with text; text explains the button anyway.
 	&:focus:not(:hover),
-	&.ck-disabled,
 	&.ck-button_with-text {
 		@include ck-tooltip_disabled();
 	}

+ 9 - 6
packages/ckeditor5-theme-lark/theme/components/dropdown.scss

@@ -23,17 +23,20 @@
 	}
 
 	.ck-button.ck-dropdown__button {
+		// Tooltips are disabled for buttons with text. Dropdowns are a different
+		// case because their buttons do not trigger the action itself but
+		// give an access to a set of actions. What is displayed in the button
+		// label not necessarily describes purpose of the dropdown (but it's state)
+		// so tooltips should be enabled here.
 		@include ck-tooltip_enabled();
 
-		&:hover,
-		&:focus:hover {
+		&:hover {
 			@include ck-tooltip_visible();
 		}
 
-		// 1. Get rid of the focus outline around the tooltip when focused (but not :hover).
-		// 2. Don't display tooltips for disabled buttons, they're unavailable anyway.
-		&:focus:not(:hover),
-		&.ck-disabled {
+		// Get rid of the focus outline around the tooltip when focused
+		// (but keep it when :hover).
+		&:focus:not(:hover) {
 			@include ck-tooltip_disabled();
 		}
 

+ 6 - 0
packages/ckeditor5-theme-lark/theme/components/editor.scss

@@ -21,6 +21,12 @@
 		&.ck-on {
 			@include ck-button-colors( 'foreground', -10 );
 		}
+
+		// Don't display tooltips for disabled buttons in the toolbar,
+		// they're unavailable anyway.
+		&.ck-disabled {
+			@include ck-tooltip_disabled();
+		}
 	}
 
 	.ck-dropdown__button {