Skip to content

Commit

Permalink
Merge pull request #1763 from finos/kevinhinterlong-icon-css-variables
Browse files Browse the repository at this point in the history
Allow more icons to be overridden
  • Loading branch information
texodus authored Mar 14, 2022
2 parents 4c8a0dd + a5432c5 commit 8584b72
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 21 deletions.
8 changes: 8 additions & 0 deletions rust/perspective-viewer/src/less/column-selector.less
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,19 @@
span.expression-delete-button {
padding-right: 1.5px;
padding-left: 5px;

&::before {
content: var(--column-close--content, "close")
}
}

span.expression-edit-button {
padding-left: 1.5px;
padding-right: 3px;

&::before {
content: var(--column-menu--content, "menu")
}
}

.column_selector_draggable {
Expand Down
9 changes: 9 additions & 0 deletions rust/perspective-viewer/src/less/config-selector.less
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@
margin-top: 2px;
margin-left: 3px;
margin-right: 0px;

&:before {
content: var(--column-close--content, "X");
}
&:hover {
opacity: 1;
color: var(--active--color, inherit);
}
}

.pivot-column {
Expand Down Expand Up @@ -232,6 +237,10 @@
cursor: pointer;
font-family: var(--button--font-family, inherit);
font-display: block;
&:hover {
opacity: 1;
color: var(--active--color, inherit);
}

&.desc:before {
content: var(--sort-order-desc--content, "\2193");
Expand Down
4 changes: 4 additions & 0 deletions rust/perspective-viewer/src/less/status-bar.less
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
margin-left: auto;
}

#counter-arrow::before {
content: var(--status-bar-counter--content, "arrow_back");
}

span {
font-size: 12px;
margin: 0px 10px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,29 +139,20 @@ impl Component for ExpressionToolbar {
<span
onmousedown={ close }
class="expression-delete-button">
{
"close"
}
</span>
}
} else {
html! {
<span
class="expression-delete-button"
style="opacity:0">
{
"close"
}
</span>
}
}
}
<span
onmousedown={ edit }
class="expression-edit-button">
{
"menu"
}
</span>
</>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Component for StatusBarRowsCounter {
html! {
<>
<span>{ format!("{} ", vrows) }</span>
<span class="icon">{ "arrow_back" }</span>
<span id="counter-arrow" class="icon"></span>
<span>{ format!(" {} rows", nrows) }</span>
</>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub fn test_status_table_and_view_loaded() {
let rows = div.query_selector("#rows").unwrap().unwrap().inner_html();
assert_eq!(
rows,
"\
<span>54,321 </span><span class=\"icon\">arrow_back</span><span> 12,345,678 rows</span>"
"<span>54,321 </span><span id=\"counter-arrow\" class=\"icon\"></span><span> 12,345,678 \
rows</span>"
);
}
2 changes: 2 additions & 0 deletions rust/perspective-viewer/src/themes/material.less
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ perspective-expression-editor[theme="Material Light"],
--config-button-icon--content: "more_vert";
--overflow-hint-icon--content: "error_outline";
--status-icon--content: "circle";
--status-bar-counter--content: "arrow_back";
--reset-button-icon--content: "refresh";
--export-button-icon--content: "download";
--copy-button-icon--content: "content_copy";
Expand All @@ -120,6 +121,7 @@ perspective-expression-editor[theme="Material Light"],

// "New Column" icon
--column-add--content: "add";
--column-menu--content: "menu";

// close "New Column" icon
--column-close--content: "close";
Expand Down
18 changes: 9 additions & 9 deletions rust/perspective-viewer/test/results/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"superstore.html/doesn't leak elements.": "d0fd18b3d4d7c183c5ed155b4bf37972",
"superstore.html/doesn't leak views when setting group by.": "54daaa4bbbe59f6ed4acc301ba871bab",
"superstore.html/doesn't leak views when setting filters.": "6dfc1e505f1428424c3265f0236f22fc",
"__GIT_COMMIT__": "d29a474913521f45b1d6b1a113923e515071c167",
"__GIT_COMMIT__": "042876bc9248db7bd81b92f7d9422d9397fbc81f",
"blank.html/Handles reloading with a schema.": "e58c62f6e0ff16dc4d753f99e0fc39c3",
"superstore_shows_a_grid_without_any_settings_applied_": "ae1c4690d978598ca14c8669244ce604",
"superstore_Responsive_Layout_shows_horizontal_columns_on_small_vertical_viewports_": "57ba3ad341cf8a0e4df6ab96715ff2a0",
Expand Down Expand Up @@ -34,23 +34,23 @@
"superstore_filters_filters_with__in__comparator": "f5cbc3b870eb94b12be03661d409ca38",
"Expressions_click_on_add_column_button_opens_the_expression_UI_": "ef5c3bd33fa42785eb5663117d559ee4",
"Expressions_blur_closes_the_expression_UI_": "10d1208b485425756fcc932229386b02",
"Expressions_Should_show_both_aliased_and_non-aliased_expressions_in_columns": "3438992f757f176a03ee0387df4ea2a7",
"Expressions_Should_show_both_aliased_and_non-aliased_expressions_in_columns": "b3a96b00241ef1eec4ddb7737f5b5389",
"Expressions_An_expression_with_unknown_symbols_should_disable_the_save_button": "075ae3d2fc31640504f814f60e5ef713",
"Expressions_A_type-invalid_expression_should_disable_the_save_button": "075ae3d2fc31640504f814f60e5ef713",
"Expressions_An_expression_with_invalid_input_columns_should_disable_the_save_button": "075ae3d2fc31640504f814f60e5ef713",
"Expressions_Should_overwrite_a_duplicate_expression_alias": "45f7fa20410660f4039ae80b1596b231",
"Expressions_Should_overwrite_a_duplicate_expression_alias": "e4db2f565a0ee4db2e38a200394116f7",
"Expressions_Should_save_an_expression_when_the_save_butotn_is_clicked": "d41d8cd98f00b204e9800998ecf8427e",
"Expressions_Should_save_an_expression_when_the_save_button_is_clicked": "1499e6adf62a42f6a484ce0b355883c2",
"Expressions_Should_overwrite_a_duplicate_expression": "6187962299b71b5ffe707a544e959a32",
"Expressions_Should_overwrite_a_duplicate_expression": "b6dfce59969b1f645ead1175deb07b50",
"Expressions_Resetting_the_viewer_should_delete_all_expressions": "1499e6adf62a42f6a484ce0b355883c2",
"Expressions_Resetting_the_viewer_when_expression_as_in_columns_field,_should_delete_all_expressions": "1499e6adf62a42f6a484ce0b355883c2",
"Expressions_Resetting_the_viewer_when_expression_as_in_group_by,_split_by_or_other_field,_should_delete_all_expressions": "d41d8cd98f00b204e9800998ecf8427e",
"Expressions_Resetting_the_viewer_when_expression_as_in_group_by_or_other_field,_should_delete_all_expressions": "1499e6adf62a42f6a484ce0b355883c2",
"Expressions_Expressions_should_persist_when_new_views_are_created_which_don_t_use_them": "b901f4c275d4d23c27122abbfd2b78ac",
"Expressions_Expressions_should_persist_when_new_views_are_created_using_them": "7cc53836293cb63433e38401bc60dfc8",
"Expressions_Expressions_should_persist_when_new_views_are_created_which_don_t_use_them": "e5a61cd8d6b3f02811ddcbacd4636889",
"Expressions_Expressions_should_persist_when_new_views_are_created_using_them": "db75ec6cc037c79ea4171e1cbb539898",
"Expressions_Aggregates_for_expressions_should_apply": "1499e6adf62a42f6a484ce0b355883c2",
"Expressions_Sorts_by_expressions_should_apply": "88e3cf1ff656ca1e431b52ac87644234",
"Expressions_Should_sort_by_hidden_expressions": "51f1f5b7fdf4e94e562ba8fa4b35ea41",
"Expressions_Should_sort_by_hidden_expressions": "125298237c1aca31bd3ba3848c53adb1",
"Expressions_Should_filter_by_an_expression": "1499e6adf62a42f6a484ce0b355883c2",
"superstore_doesn_t_leak_elements_": "e3198149f2e782e113b755d4fb7d0953",
"superstore_doesn_t_leak_views_when_setting_group_by_": "4908fc388aa779cd238d1b05ab1ddafe",
Expand All @@ -66,8 +66,8 @@
"superstore_save_returns_the_current_config": "06b1128d94ddb953f8c5b6adf49f4756",
"superstore_restore_restores_a_config_from_save": "43141e5cf7c0554cce759d3f7ea16133",
"Expressions_Click_on_add_column_button_opens_the_expression_UI_": "40bb9b2f39e1cd296752d42c694a4f05",
"Expressions_Resetting_the_viewer_partially_should_not_delete_all_expressions": "b901f4c275d4d23c27122abbfd2b78ac",
"Expressions_Resetting_the_viewer_partially_when_expression_as_in_columns_field,_should_not_delete_all_expressions": "b901f4c275d4d23c27122abbfd2b78ac",
"Expressions_Resetting_the_viewer_partially_should_not_delete_all_expressions": "e5a61cd8d6b3f02811ddcbacd4636889",
"Expressions_Resetting_the_viewer_partially_when_expression_as_in_columns_field,_should_not_delete_all_expressions": "e5a61cd8d6b3f02811ddcbacd4636889",
"superstore-all_restore__Bucket_by_year_": "e553e253c983516dea41eb584a889612",
"superstore-all_restore__Plugin_config_color_mode_": "e15272040eea436c123116c69c11a3e8",
"dragdrop_superstore_drop_from_inactive_to_active_should_add": "d9647ef9ee823e5a755fd82f59bc17dd",
Expand Down

0 comments on commit 8584b72

Please sign in to comment.