Theme: Reworking button styling (#16362)

* added new variables for height in theme, added height to gui button large, replaced add gicon with regular gicon, replaced + with gicon, changed button display to flex

* set fixed height to large button, removed xlarge button and replaced with large button

* removed button-mini and replaced with button-small, set fixed height to default button and button-small

* fixed padding for default and large button, fixed height for navbar button, fixed snapshots

* fixed padding and margin on navbar buttons

* gave special height to login btn-primary

* readded btn-mini class with same styling as btn-small and a deprecated notice

* fixed add panel widget buttons
This commit is contained in:
Patrick O'Carroll 2019-04-08 09:48:15 +02:00 committed by Torkel Ödegaard
parent 9b39dbc2fb
commit 128fb8fa7e
35 changed files with 130 additions and 100 deletions

View File

@ -65,35 +65,28 @@ const getButtonStyles = (theme: GrafanaTheme, size: ButtonSize, variant: ButtonV
background, background,
fontSize, fontSize,
iconDistance, iconDistance,
height,
fontWeight = theme.typography.weight.semibold; fontWeight = theme.typography.weight.semibold;
switch (size) { switch (size) {
case ButtonSize.ExtraSmall:
padding = `${theme.spacing.xs} ${theme.spacing.sm}`;
fontSize = theme.typography.size.xs;
iconDistance = theme.spacing.xs;
break;
case ButtonSize.Small: case ButtonSize.Small:
padding = `${theme.spacing.xs} ${theme.spacing.sm}`; padding = `${theme.spacing.xs} ${theme.spacing.sm}`;
fontSize = theme.typography.size.sm; fontSize = theme.typography.size.sm;
iconDistance = theme.spacing.xs; iconDistance = theme.spacing.xs;
height = theme.height.sm;
break; break;
case ButtonSize.Large: case ButtonSize.Large:
padding = `${theme.spacing.md} ${theme.spacing.lg}`; padding = `${theme.spacing.md} ${theme.spacing.lg}`;
fontSize = theme.typography.size.lg; fontSize = theme.typography.size.lg;
fontWeight = theme.typography.weight.regular; fontWeight = theme.typography.weight.regular;
iconDistance = theme.spacing.sm; iconDistance = theme.spacing.sm;
break; height = theme.height.lg;
case ButtonSize.ExtraLarge:
padding = `${theme.spacing.md} ${theme.spacing.lg}`;
fontSize = theme.typography.size.lg;
fontWeight = theme.typography.weight.regular;
iconDistance = theme.spacing.sm;
break; break;
default: default:
padding = `${theme.spacing.sm} ${theme.spacing.md}`; padding = `${theme.spacing.sm} ${theme.spacing.md}`;
iconDistance = theme.spacing.sm; iconDistance = theme.spacing.sm;
fontSize = theme.typography.size.base; fontSize = theme.typography.size.base;
height = theme.height.md;
} }
switch (variant) { switch (variant) {
@ -133,7 +126,8 @@ const getButtonStyles = (theme: GrafanaTheme, size: ButtonSize, variant: ButtonV
return { return {
button: css` button: css`
label: button; label: button;
display: inline-block; display: flex;
align-items: center;
font-weight: ${fontWeight}; font-weight: ${fontWeight};
font-size: ${fontSize}; font-size: ${fontSize};
font-family: ${theme.typography.fontFamily.sansSerif}; font-family: ${theme.typography.fontFamily.sansSerif};
@ -143,6 +137,7 @@ const getButtonStyles = (theme: GrafanaTheme, size: ButtonSize, variant: ButtonV
vertical-align: middle; vertical-align: middle;
cursor: pointer; cursor: pointer;
border: none; border: none;
height: ${height};
border-radius: ${borderRadius}; border-radius: ${borderRadius};
${background}; ${background};
@ -161,6 +156,7 @@ const getButtonStyles = (theme: GrafanaTheme, size: ButtonSize, variant: ButtonV
icon: css` icon: css`
label: button-icon; label: button-icon;
margin-right: ${iconDistance}; margin-right: ${iconDistance};
filter: brightness(100);
`, `,
}; };
}; };

View File

@ -48,7 +48,7 @@ ButtonStories.add('with icon', () => {
Plus: 'fa fa-plus', Plus: 'fa fa-plus',
User: 'fa fa-user', User: 'fa fa-user',
Gear: 'fa fa-gear', Gear: 'fa fa-gear',
Annotation: 'gicon gicon-add-annotation', Annotation: 'gicon gicon-annotation',
}, },
'fa fa-plus' 'fa fa-plus'
); );

View File

@ -176,6 +176,11 @@ exports[`Render should render with base threshold 1`] = `
"white": "#ffffff", "white": "#ffffff",
"yellow": "#ecbb13", "yellow": "#ecbb13",
}, },
"height": Object {
"lg": "48px",
"md": "32px",
"sm": "24px",
},
"name": "Grafana Dark", "name": "Grafana Dark",
"panelPadding": Object { "panelPadding": Object {
"horizontal": 16, "horizontal": 16,
@ -334,6 +339,11 @@ exports[`Render should render with base threshold 1`] = `
"white": "#ffffff", "white": "#ffffff",
"yellow": "#ecbb13", "yellow": "#ecbb13",
}, },
"height": Object {
"lg": "48px",
"md": "32px",
"sm": "24px",
},
"name": "Grafana Dark", "name": "Grafana Dark",
"panelPadding": Object { "panelPadding": Object {
"horizontal": 16, "horizontal": 16,

View File

@ -87,6 +87,12 @@ $container-max-widths: (
$grid-columns: 12 !default; $grid-columns: 12 !default;
$grid-gutter-width: ${theme.spacing.gutter} !default; $grid-gutter-width: ${theme.spacing.gutter} !default;
// Component heights
// -------------------------
$height-sm: ${theme.height.sm};
$height-md: ${theme.height.md};
$height-lg: ${theme.height.lg};
// Typography // Typography
// ------------------------- // -------------------------

View File

@ -67,6 +67,11 @@ const theme: GrafanaThemeCommons = {
sm: '1px', sm: '1px',
}, },
}, },
height: {
sm: '24px',
md: '32px',
lg: '48px',
},
panelPadding: { panelPadding: {
horizontal: 16, horizontal: 16,
vertical: 8, vertical: 8,

View File

@ -72,6 +72,11 @@ export interface GrafanaThemeCommons {
sm: string; sm: string;
}; };
}; };
height: {
sm: string;
md: string;
lg: string;
};
panelPadding: { panelPadding: {
horizontal: number; horizontal: number;
vertical: number; vertical: number;

View File

@ -1,5 +1,5 @@
import React, { useContext } from 'react'; import React, { useContext } from 'react';
import { CallToActionCard, ExtraLargeLinkButton, ThemeContext } from '@grafana/ui'; import { CallToActionCard, LargeLinkButton, ThemeContext } from '@grafana/ui';
import { css } from 'emotion'; import { css } from 'emotion';
export interface Props { export interface Props {
model: any; model: any;
@ -37,9 +37,9 @@ const EmptyListCTA: React.FunctionComponent<Props> = props => {
: ''; : '';
const ctaElement = ( const ctaElement = (
<ExtraLargeLinkButton onClick={onClick} href={buttonLink} icon={buttonIcon} className={ctaElementClassName}> <LargeLinkButton onClick={onClick} href={buttonLink} icon={buttonIcon} className={ctaElementClassName}>
{buttonTitle} {buttonTitle}
</ExtraLargeLinkButton> </LargeLinkButton>
); );
return <CallToActionCard message={title} footer={footer} callToActionElement={ctaElement} theme={theme} />; return <CallToActionCard message={title} footer={footer} callToActionElement={ctaElement} theme={theme} />;

View File

@ -29,10 +29,10 @@ const template = `
<td>{{org.name}}</td> <td>{{org.name}}</td>
<td>{{org.role}}</td> <td>{{org.role}}</td>
<td class="text-right"> <td class="text-right">
<span class="btn btn-primary btn-mini" ng-show="org.orgId === ctrl.currentOrgId"> <span class="btn btn-primary btn-small" ng-show="org.orgId === ctrl.currentOrgId">
Current Current
</span> </span>
<a ng-click="ctrl.setUsingOrg(org)" class="btn btn-inverse btn-mini" ng-show="org.orgId !== ctrl.currentOrgId"> <a ng-click="ctrl.setUsingOrg(org)" class="btn btn-inverse btn-small" ng-show="org.orgId !== ctrl.currentOrgId">
Switch to Switch to
</a> </a>
</td> </td>

View File

@ -35,7 +35,7 @@
</div> </div>
</td> </td>
<td style="width: 1%"> <td style="width: 1%">
<a ng-click="removeOrgUser(orgUser)" class="btn btn-danger btn-mini"> <a ng-click="removeOrgUser(orgUser)" class="btn btn-danger btn-small">
<i class="fa fa-remove"></i> <i class="fa fa-remove"></i>
</a> </a>
</td> </td>

View File

@ -91,7 +91,7 @@
</div> </div>
</td> </td>
<td style="width: 1%"> <td style="width: 1%">
<a ng-click="removeOrgUser(org)" class="btn btn-danger btn-mini"> <a ng-click="removeOrgUser(org)" class="btn btn-danger btn-small">
<i class="fa fa-remove"></i> <i class="fa fa-remove"></i>
</a> </a>
</td> </td>

View File

@ -72,7 +72,7 @@ class StateHistory extends PureComponent<Props, State> {
{stateHistoryItems.length > 0 && ( {stateHistoryItems.length > 0 && (
<div className="p-b-1"> <div className="p-b-1">
<span className="muted">Last 50 state changes</span> <span className="muted">Last 50 state changes</span>
<button className="btn btn-mini btn-danger pull-right" onClick={this.clearHistory}> <button className="btn btn-small btn-danger pull-right" onClick={this.clearHistory}>
<i className="fa fa-trash" /> {` Clear history`} <i className="fa fa-trash" /> {` Clear history`}
</button> </button>
</div> </div>

View File

@ -47,7 +47,7 @@
<div ng-if="ctrl.notifications.length === 0"> <div ng-if="ctrl.notifications.length === 0">
<empty-list-cta model="{ <empty-list-cta model="{
title: 'There are no notification channels defined yet', title: 'There are no notification channels defined yet',
buttonIcon: 'gicon gicon-add-alert-notification-channel', buttonIcon: 'gicon gicon-alert-notification-channel',
buttonLink: 'alerting/notification/new', buttonLink: 'alerting/notification/new',
buttonTitle: 'Add channel', buttonTitle: 'Add channel',
proTip: 'You can include images in your alert notifications.', proTip: 'You can include images in your alert notifications.',

View File

@ -36,7 +36,7 @@
<td style="width: 1%"><i ng-click="ctrl.move($index,-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td> <td style="width: 1%"><i ng-click="ctrl.move($index,-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
<td style="width: 1%"><i ng-click="ctrl.move($index,1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td> <td style="width: 1%"><i ng-click="ctrl.move($index,1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
<td style="width: 1%"> <td style="width: 1%">
<a ng-click="ctrl.removeAnnotation(annotation)" class="btn btn-danger btn-mini" ng-hide="annotation.builtIn"> <a ng-click="ctrl.removeAnnotation(annotation)" class="btn btn-danger btn-small" ng-hide="annotation.builtIn">
<i class="fa fa-remove"></i> <i class="fa fa-remove"></i>
</a> </a>
</td> </td>
@ -48,8 +48,8 @@
<div ng-if="ctrl.annotations.length === 1" class="p-t-2"> <div ng-if="ctrl.annotations.length === 1" class="p-t-2">
<div class="empty-list-cta"> <div class="empty-list-cta">
<div class="empty-list-cta__title">There are no custom annotation queries added yet</div> <div class="empty-list-cta__title">There are no custom annotation queries added yet</div>
<a ng-click="ctrl.setupNew()" class="empty-list-cta__button btn btn-xlarge btn-primary"> <a ng-click="ctrl.setupNew()" class="empty-list-cta__button btn btn-large btn-primary">
<i class="gicon gicon-add-annotation"></i> <i class="gicon gicon-annotation"></i>
Add Annotation Query Add Annotation Query
</a> </a>
<div class="grafana-info-box"> <div class="grafana-info-box">

View File

@ -113,7 +113,7 @@ export class ApiKeysPage extends PureComponent<Props, any> {
<EmptyListCTA <EmptyListCTA
model={{ model={{
title: "You haven't added any API Keys yet.", title: "You haven't added any API Keys yet.",
buttonIcon: 'fa fa-plus', buttonIcon: 'gicon gicon-apikeys',
buttonLink: '#', buttonLink: '#',
onClick: this.onToggleAdding, onClick: this.onToggleAdding,
buttonTitle: ' New API Key', buttonTitle: ' New API Key',

View File

@ -38,7 +38,7 @@ exports[`Render should render CTA if there are no API keys 1`] = `
<EmptyListCTA <EmptyListCTA
model={ model={
Object { Object {
"buttonIcon": "fa fa-plus", "buttonIcon": "gicon gicon-apikeys",
"buttonLink": "#", "buttonLink": "#",
"buttonTitle": " New API Key", "buttonTitle": " New API Key",
"onClick": [Function], "onClick": [Function],

View File

@ -37,7 +37,9 @@
.add-panel-widget__link { .add-panel-widget__link {
margin: 0 $space-sm; margin: 0 $space-sm;
width: 154px; width: 160px;
height: 88px !important;
flex-direction: column !important;
} }
.add-panel-widget__icon { .add-panel-widget__icon {

View File

@ -10,8 +10,8 @@
<div class="empty-list-cta__title"> <div class="empty-list-cta__title">
There are no dashboard links added yet There are no dashboard links added yet
</div> </div>
<a ng-click="ctrl.setupNew()" class="empty-list-cta__button btn btn-xlarge btn-primary"> <a ng-click="ctrl.setupNew()" class="empty-list-cta__button btn btn-large btn-primary">
<i class="gicon gicon-add-link"></i> <i class="gicon gicon-link"></i>
Add Dashboard Link Add Dashboard Link
</a> </a>
<div class="grafana-info-box"> <div class="grafana-info-box">
@ -61,7 +61,7 @@
<i ng-click="ctrl.moveLink($index, 1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i> <i ng-click="ctrl.moveLink($index, 1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i>
</td> </td>
<td style="width: 1%"> <td style="width: 1%">
<a ng-click="ctrl.deleteLink($index)" class="btn btn-danger btn-mini" ng-hide="annotation.builtIn"> <a ng-click="ctrl.deleteLink($index)" class="btn btn-danger btn-small" ng-hide="annotation.builtIn">
<i class="fa fa-remove"></i> <i class="fa fa-remove"></i>
</a> </a>
</td> </td>

View File

@ -21,7 +21,7 @@ export class DataSourcesListItem extends PureComponent<Props> {
<div className="card-item-details"> <div className="card-item-details">
<div className="card-item-name"> <div className="card-item-name">
{dataSource.name} {dataSource.name}
{dataSource.isDefault && <span className="btn btn-secondary btn-mini card-item-label">default</span>} {dataSource.isDefault && <span className="btn btn-secondary btn-small card-item-label">default</span>}
</div> </div>
<div className="card-item-sub-name">{dataSource.url}</div> <div className="card-item-sub-name">{dataSource.url}</div>
</div> </div>

View File

@ -39,7 +39,7 @@ export interface Props {
const emptyListModel = { const emptyListModel = {
title: 'There are no data sources defined yet', title: 'There are no data sources defined yet',
buttonIcon: 'gicon gicon-add-datasources', buttonIcon: 'gicon gicon-datasources',
buttonLink: 'datasources/new', buttonLink: 'datasources/new',
buttonTitle: 'Add data source', buttonTitle: 'Add data source',
proTip: 'You can also define data sources through configuration files.', proTip: 'You can also define data sources through configuration files.',

View File

@ -1,6 +1,6 @@
import React, { useContext } from 'react'; import React, { useContext } from 'react';
import { css } from 'emotion'; import { css } from 'emotion';
import { ThemeContext, ExtraLargeLinkButton, CallToActionCard } from '@grafana/ui'; import { ThemeContext, LargeLinkButton, CallToActionCard } from '@grafana/ui';
export const NoDataSourceCallToAction = () => { export const NoDataSourceCallToAction = () => {
const theme = useContext(ThemeContext); const theme = useContext(ThemeContext);
@ -22,9 +22,9 @@ export const NoDataSourceCallToAction = () => {
); );
const ctaElement = ( const ctaElement = (
<ExtraLargeLinkButton href="/datasources/new" icon="gicon gicon-add-datasources"> <LargeLinkButton href="/datasources/new" icon="gicon gicon-datasources">
Add data source Add data source
</ExtraLargeLinkButton> </LargeLinkButton>
); );
const cardClassName = css` const cardClassName = css`

View File

@ -20,13 +20,13 @@
<span class="query-keyword" ng-if="snapshot.external">External</span> <span class="query-keyword" ng-if="snapshot.external">External</span>
</td> </td>
<td class="text-center"> <td class="text-center">
<a href="{{snapshot.url}}" class="btn btn-inverse btn-mini"> <a href="{{snapshot.url}}" class="btn btn-inverse btn-small">
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
View View
</a> </a>
</td> </td>
<td class="text-right"> <td class="text-right">
<a ng-click="ctrl.removeSnapshot(snapshot)" class="btn btn-danger btn-mini"> <a ng-click="ctrl.removeSnapshot(snapshot)" class="btn btn-danger btn-small">
<i class="fa fa-remove"></i> <i class="fa fa-remove"></i>
</a> </a>
</td> </td>

View File

@ -34,13 +34,13 @@
</td> </td>
<td class="selected-playlistitem-settings"> <td class="selected-playlistitem-settings">
<button class="btn btn-inverse btn-mini" ng-hide="$first" ng-click="ctrl.movePlaylistItemUp(playlistItem)"> <button class="btn btn-inverse btn-small" ng-hide="$first" ng-click="ctrl.movePlaylistItemUp(playlistItem)">
<i class="fa fa-arrow-up"></i> <i class="fa fa-arrow-up"></i>
</button> </button>
<button class="btn btn-inverse btn-mini" ng-hide="$last" ng-click="ctrl.movePlaylistItemDown(playlistItem)"> <button class="btn btn-inverse btn-small" ng-hide="$last" ng-click="ctrl.movePlaylistItemDown(playlistItem)">
<i class="fa fa-arrow-down"></i> <i class="fa fa-arrow-down"></i>
</button> </button>
<button class="btn btn-inverse btn-mini" ng-click="ctrl.removePlaylistItem(playlistItem)"> <button class="btn btn-inverse btn-small" ng-click="ctrl.removePlaylistItem(playlistItem)">
<i class="fa fa-remove"></i> <i class="fa fa-remove"></i>
</button> </button>
</td> </td>
@ -64,7 +64,7 @@
<i class="fa fa-star" ng-show="playlistItem.isStarred"></i> <i class="fa fa-star" ng-show="playlistItem.isStarred"></i>
</td> </td>
<td class="add-dashboard"> <td class="add-dashboard">
<button class="btn btn-inverse btn-mini pull-right" ng-click="ctrl.addPlaylistItem(playlistItem)"> <button class="btn btn-inverse btn-small pull-right" ng-click="ctrl.addPlaylistItem(playlistItem)">
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
Add to playlist Add to playlist
</button> </button>
@ -82,7 +82,7 @@
</a> </a>
</td> </td>
<td class="add-dashboard"> <td class="add-dashboard">
<button class="btn btn-inverse btn-mini pull-right" ng-click="ctrl.addTagPlaylistItem(tag)"> <button class="btn btn-inverse btn-small pull-right" ng-click="ctrl.addTagPlaylistItem(tag)">
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
Add to playlist Add to playlist
</button> </button>

View File

@ -63,10 +63,10 @@
<td>{{org.name}}</td> <td>{{org.name}}</td>
<td>{{org.role}}</td> <td>{{org.role}}</td>
<td class="text-right"> <td class="text-right">
<span class="btn btn-primary btn-mini" ng-show="org.orgId === contextSrv.user.orgId"> <span class="btn btn-primary btn-small" ng-show="org.orgId === contextSrv.user.orgId">
Current Current
</span> </span>
<a ng-click="ctrl.setUsingOrg(org)" class="btn btn-inverse btn-mini" ng-show="org.orgId !== contextSrv.user.orgId"> <a ng-click="ctrl.setUsingOrg(org)" class="btn btn-inverse btn-small" ng-show="org.orgId !== contextSrv.user.orgId">
Select Select
</a> </a>
</td> </td>

View File

@ -63,7 +63,7 @@ export class TeamGroupSync extends PureComponent<Props, State> {
<tr key={group.groupId}> <tr key={group.groupId}>
<td>{group.groupId}</td> <td>{group.groupId}</td>
<td style={{ width: '1%' }}> <td style={{ width: '1%' }}>
<a className="btn btn-danger btn-mini" onClick={() => this.onRemoveGroup(group)}> <a className="btn btn-danger btn-small" onClick={() => this.onRemoveGroup(group)}>
<i className="fa fa-remove" /> <i className="fa fa-remove" />
</a> </a>
</td> </td>
@ -121,8 +121,8 @@ export class TeamGroupSync extends PureComponent<Props, State> {
{groups.length === 0 && !isAdding && ( {groups.length === 0 && !isAdding && (
<div className="empty-list-cta"> <div className="empty-list-cta">
<div className="empty-list-cta__title">There are no external groups to sync with</div> <div className="empty-list-cta__title">There are no external groups to sync with</div>
<button onClick={this.onToggleAdding} className="empty-list-cta__button btn btn-xlarge btn-primary"> <button onClick={this.onToggleAdding} className="empty-list-cta__button btn btn-large btn-primary">
<i className="gicon gicon-add-team" /> <i className="gicon gicon-team" />
Add Group Add Group
</button> </button>
<div className="empty-list-cta__pro-tip"> <div className="empty-list-cta__pro-tip">

View File

@ -73,20 +73,18 @@ export class TeamList extends PureComponent<Props, any> {
renderEmptyList() { renderEmptyList() {
return ( return (
<div className="page-container page-body"> <EmptyListCTA
<EmptyListCTA model={{
model={{ title: "You haven't created any teams yet.",
title: "You haven't created any teams yet.", buttonIcon: 'gicon gicon-team',
buttonIcon: 'fa fa-plus', buttonLink: 'org/teams/new',
buttonLink: 'org/teams/new', buttonTitle: ' New team',
buttonTitle: ' New team', proTip: 'Assign folder and dashboard permissions to teams instead of users to ease administration.',
proTip: 'Assign folder and dashboard permissions to teams instead of users to ease administration.', proTipLink: '',
proTipLink: '', proTipLinkTitle: '',
proTipLinkTitle: '', proTipTarget: '_blank',
proTipTarget: '_blank', }}
}} />
/>
</div>
); );
} }

View File

@ -81,11 +81,11 @@ exports[`Render should render component 1`] = `
There are no external groups to sync with There are no external groups to sync with
</div> </div>
<button <button
className="empty-list-cta__button btn btn-xlarge btn-primary" className="empty-list-cta__button btn btn-large btn-primary"
onClick={[Function]} onClick={[Function]}
> >
<i <i
className="gicon gicon-add-team" className="gicon gicon-team"
/> />
Add Group Add Group
</button> </button>
@ -225,7 +225,7 @@ exports[`Render should render groups table 1`] = `
} }
> >
<a <a
className="btn btn-danger btn-mini" className="btn btn-danger btn-small"
onClick={[Function]} onClick={[Function]}
> >
<i <i
@ -248,7 +248,7 @@ exports[`Render should render groups table 1`] = `
} }
> >
<a <a
className="btn btn-danger btn-mini" className="btn btn-danger btn-small"
onClick={[Function]} onClick={[Function]}
> >
<i <i
@ -271,7 +271,7 @@ exports[`Render should render groups table 1`] = `
} }
> >
<a <a
className="btn btn-danger btn-mini" className="btn btn-danger btn-small"
onClick={[Function]} onClick={[Function]}
> >
<i <i

View File

@ -18,8 +18,8 @@
<input class="gf-form-input max-width-22" type="email" ng-model="ctrl.email" placeholder="email@test.com"> <input class="gf-form-input max-width-22" type="email" ng-model="ctrl.email" placeholder="email@test.com">
</div> </div>
<div class="gf-form-button-row"> <div class="gf-form-button-row">
<button type="submit" class="btn btn-primary width-12"> <button type="submit" class="btn btn-primary">
<i class="fa fa-save"></i> Create Create
</button> </button>
</div> </div>
</form> </form>

View File

@ -11,8 +11,8 @@
<div ng-if="variables.length === 0"> <div ng-if="variables.length === 0">
<div class="empty-list-cta"> <div class="empty-list-cta">
<div class="empty-list-cta__title">There are no variables added yet</div> <div class="empty-list-cta__title">There are no variables added yet</div>
<a ng-click="setMode('new')" class="empty-list-cta__button btn btn-xlarge btn-primary"> <a ng-click="setMode('new')" class="empty-list-cta__button btn btn-large btn-primary">
<i class="gicon gicon-add-variable"></i> <i class="gicon gicon-variable"></i>
Add variable Add variable
</a> </a>
<div class="grafana-info-box"> <div class="grafana-info-box">
@ -58,12 +58,12 @@
<td style="width: 1%"><i ng-click="_.move(variables,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td> <td style="width: 1%"><i ng-click="_.move(variables,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
<td style="width: 1%"><i ng-click="_.move(variables,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td> <td style="width: 1%"><i ng-click="_.move(variables,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
<td style="width: 1%"> <td style="width: 1%">
<a ng-click="duplicate(variable)" class="btn btn-inverse btn-mini"> <a ng-click="duplicate(variable)" class="btn btn-inverse btn-small">
Duplicate Duplicate
</a> </a>
</td> </td>
<td style="width: 1%"> <td style="width: 1%">
<a ng-click="removeVariable(variable)" class="btn btn-danger btn-mini"> <a ng-click="removeVariable(variable)" class="btn btn-danger btn-small">
<i class="fa fa-remove"></i> <i class="fa fa-remove"></i>
</a> </a>
</td> </td>

View File

@ -27,7 +27,7 @@ class InviteeRow extends PureComponent<Props> {
<td>{invitee.email}</td> <td>{invitee.email}</td>
<td>{invitee.name}</td> <td>{invitee.name}</td>
<td className="text-right"> <td className="text-right">
<button className="btn btn-inverse btn-mini" onClick={this.copyToClipboard}> <button className="btn btn-inverse btn-small" onClick={this.copyToClipboard}>
<textarea <textarea
readOnly={true} readOnly={true}
value={invitee.url} value={invitee.url}
@ -39,7 +39,7 @@ class InviteeRow extends PureComponent<Props> {
&nbsp; &nbsp;
</td> </td>
<td> <td>
<button className="btn btn-danger btn-mini" onClick={() => revokeInvite(invitee.code)}> <button className="btn btn-danger btn-small" onClick={() => revokeInvite(invitee.code)}>
<i className="fa fa-remove" /> <i className="fa fa-remove" />
</button> </button>
</td> </td>

View File

@ -52,7 +52,7 @@ const UsersTable: FC<Props> = props => {
</div> </div>
</td> </td>
<td> <td>
<div onClick={() => onRemoveUser(user)} className="btn btn-danger btn-mini"> <div onClick={() => onRemoveUser(user)} className="btn btn-danger btn-small">
<i className="fa fa-remove" /> <i className="fa fa-remove" />
</div> </div>
</td> </td>

View File

@ -115,7 +115,7 @@ exports[`Render should render users table 1`] = `
</td> </td>
<td> <td>
<div <div
className="btn btn-danger btn-mini" className="btn btn-danger btn-small"
onClick={[Function]} onClick={[Function]}
> >
<i <i
@ -178,7 +178,7 @@ exports[`Render should render users table 1`] = `
</td> </td>
<td> <td>
<div <div
className="btn btn-danger btn-mini" className="btn btn-danger btn-small"
onClick={[Function]} onClick={[Function]}
> >
<i <i
@ -241,7 +241,7 @@ exports[`Render should render users table 1`] = `
</td> </td>
<td> <td>
<div <div
className="btn btn-danger btn-mini" className="btn btn-danger btn-small"
onClick={[Function]} onClick={[Function]}
> >
<i <i
@ -304,7 +304,7 @@ exports[`Render should render users table 1`] = `
</td> </td>
<td> <td>
<div <div
className="btn btn-danger btn-mini" className="btn btn-danger btn-small"
onClick={[Function]} onClick={[Function]}
> >
<i <i
@ -367,7 +367,7 @@ exports[`Render should render users table 1`] = `
</td> </td>
<td> <td>
<div <div
className="btn btn-danger btn-mini" className="btn btn-danger btn-small"
onClick={[Function]} onClick={[Function]}
> >
<i <i
@ -430,7 +430,7 @@ exports[`Render should render users table 1`] = `
</td> </td>
<td> <td>
<div <div
className="btn btn-danger btn-mini" className="btn btn-danger btn-small"
onClick={[Function]} onClick={[Function]}
> >
<i <i

View File

@ -90,6 +90,12 @@ $container-max-widths: (
$grid-columns: 12 !default; $grid-columns: 12 !default;
$grid-gutter-width: 30px !default; $grid-gutter-width: 30px !default;
// Component heights
// -------------------------
$height-sm: 24px;
$height-md: 32px;
$height-lg: 48px;
// Typography // Typography
// ------------------------- // -------------------------

View File

@ -7,7 +7,9 @@
// Core // Core
.btn { .btn {
display: inline-block; display: inline-flex;
align-items: center;
justify-content: center;
font-weight: $btn-font-weight; font-weight: $btn-font-weight;
line-height: $btn-line-height; line-height: $btn-line-height;
font-size: $font-size-base; font-size: $font-size-base;
@ -15,8 +17,9 @@
vertical-align: middle; vertical-align: middle;
cursor: pointer; cursor: pointer;
border: none; border: none;
height: $height-md;
@include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $border-radius-sm); @include button-size($btn-padding-y, $space-md, $font-size-base, $border-radius-sm);
&, &,
&:active, &:active,
@ -51,29 +54,28 @@
// Button Sizes // Button Sizes
// -------------------------------------------------- // --------------------------------------------------
// XLarge
.btn-xlarge {
@include button-size($btn-padding-y-xl, $btn-padding-x-xl, $font-size-lg, $border-radius-sm);
font-weight: normal;
padding-bottom: $btn-padding-y-xl - 3;
.gicon {
font-size: 31px;
margin-right: $space-md;
}
}
// Large // Large
.btn-large { .btn-large {
@include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $border-radius-sm); @include button-size($btn-padding-y-lg, $space-lg, $font-size-lg, $border-radius-sm);
font-weight: normal; font-weight: normal;
height: $height-lg;
.gicon {
//font-size: 31px;
margin-right: $space-sm;
filter: brightness(100);
}
} }
.btn-small { .btn-small {
@include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $border-radius-sm); @include button-size($btn-padding-y-sm, $space-sm, $font-size-sm, $border-radius-sm);
height: $height-sm;
} }
// Deprecated, only used by old plugins
.btn-mini { .btn-mini {
@include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-xs, $border-radius-sm); @include button-size($btn-padding-y-sm, $space-sm, $font-size-sm, $border-radius-sm);
height: $height-sm;
} }
.btn-link { .btn-link {

View File

@ -112,12 +112,11 @@
display: flex; display: flex;
align-items: center; align-items: center;
font-weight: $btn-font-weight; font-weight: $btn-font-weight;
padding: 6px 11px; padding: 6px $space-sm;
line-height: 16px; line-height: 16px;
height: 30px;
color: $text-muted; color: $text-muted;
border: 1px solid $navbar-button-border; border: 1px solid $navbar-button-border;
margin-left: 3px; margin-left: $space-xs;
white-space: nowrap; white-space: nowrap;
.gicon { .gicon {

View File

@ -20,6 +20,7 @@ $login-border: #8daac5;
& .btn-primary { & .btn-primary {
@include buttonBackground(#ff6600, #bc3e06); @include buttonBackground(#ff6600, #bc3e06);
height: 40px;
} }
} }