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

Single page pagination, button reset, table header sorting, codeblock styling #298

Merged
merged 6 commits into from
Jan 12, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# [`master`](https://github.com/elastic/eui/tree/master)

- Minor style-only changes to `EuiPagination`, button reset, `EuiTableHeaderCell`, and `EuiCodeBlock` [(#298)](https://github.com/elastic/eui/pull/298)
- All NPM dependencies now use ^ to install the latest minor version.
- Added Apache, Nginx, MySQL logos [(#270)](https://github.com/elastic/eui/pull/270)
- Added small version of `EuiCallOut` [(#269)](https://github.com/elastic/eui/pull/269)
Expand Down
3 changes: 2 additions & 1 deletion src/components/code/_code_block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
display: inline-block;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you remove vertical-align: middle from .euiCodeBlock--inline it will align it to the baseline.

screen shot 2018-01-12 at 11 36 47 am

vs.

screen shot 2018-01-12 at 11 36 41 am

white-space: pre;
color: $euiTextColor;
font-size: 75%; // 1
font-size: 90%; // 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that it's still slightly smaller, but this is a much better scale.

padding: 0 $euiSizeS;
background: $euiColorLightestShade;

.euiCodeBlock__pre {
Expand Down
4 changes: 0 additions & 4 deletions src/components/form/switch/switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,3 @@ EuiSwitch.propTypes = {
checked: PropTypes.bool,
onChange: PropTypes.func,
};

EuiSwitch.defaultProps = {
defaultChecked: false,
};
7 changes: 6 additions & 1 deletion src/components/pagination/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,19 @@ export const EuiPagination = ({
);
}

let selectablePages;
if (pages.length > 1) {
selectablePages = pages;
}

return (
<div
className={classes}
{...rest}
>
{previousButton}
{firstPageButtons}
{pages}
{selectablePages}
{lastPageButtons}
{nextButton}
</div>
Expand Down
1 change: 0 additions & 1 deletion src/components/table/_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@

.euiTableSortIcon {
margin-left: $euiSizeXS;
fill: tintOrShade($euiTitleColor, 80%, 70%);

.euiTableHeaderButton-isSorted & {
fill: $euiTitleColor;
Expand Down
17 changes: 10 additions & 7 deletions src/components/table/table_header_cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ export const EuiTableHeaderCell = ({
});

if (onSort) {
const sortIcon = (
<EuiIcon
className="euiTableSortIcon"
type={isSortAscending ? 'sortUp' : 'sortDown'}
size="m"
/>
);
let sortIcon;
if (isSorted) {
sortIcon = (
<EuiIcon
className="euiTableSortIcon"
type={isSortAscending ? 'sortUp' : 'sortDown'}
size="m"
/>
);
}

const buttonClasses = classNames('euiTableHeaderButton', {
'euiTableHeaderButton-isSorted': isSorted,
Expand Down
1 change: 1 addition & 0 deletions src/global_styling/reset/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ button {
color: inherit;
font-size: inherit;
border-radius: 0;
text-align: left;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have any ill cascading effects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't in EUI, but it might in the nest of Kibana. I'm gonna move it over to EuiLink which was the primary sore spot (that onClick turns EuiLink into buttons, which shouldn't have alignment). That's probably safer.


&:hover {
cursor: pointer;
Expand Down