-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate UI Framework source into Kibana.
- Add dependencies to package.json. - Add task for building UI Framework docs and serving locally. - Import UI Framework scss from autoload/styles.js instead of importing the CSS in base.less.
- Loading branch information
Showing
59 changed files
with
2,599 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ selenium | |
*.swp | ||
*.swo | ||
*.out | ||
src/ui_framework/public/*.js* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
// Kibana UI Framework | ||
require('../../../ui_framework/src/framework/framework.scss'); | ||
|
||
// All Kibana styles inside of the /styles dir | ||
const context = require.context('../styles', false, /[\/\\](?!mixins|variables|_|\.)[^\/\\]+\.less/); | ||
context.keys().forEach(key => context(key)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Kibana UI Framework | ||
|
||
## Development | ||
|
||
* Start development server `npm run uiFramework:start`. | ||
* View docs on `http://localhost:8080/`. | ||
|
||
## What is this? | ||
|
||
The UI Framework provides you with UI components you can quickly use to build UIs, as well as interactive examples which document how they're supposed to be used. These UI components are currently only implemented in CSS and markup, but eventually they'll grow to involve JS as well. | ||
|
||
When you build a UI using this framework (e.g. a plugin's UI), you can rest assured it will fit into the overall Kibana UI. | ||
|
||
## Benefits | ||
|
||
### Dynamic, interactive documentation | ||
|
||
By having a "living style guide", we relieve our designers of the burden of creating and maintaining static style guides. This also makes it easier for our engineers to translate mockups, prototypes, and wireframes into products. | ||
|
||
### Copy-pasteable UI | ||
|
||
Engineers can copy and paste sample code into their projects to quickly get reliable, consistent results. | ||
|
||
### Remove CSS from the day-to-day | ||
|
||
The CSS portion of this framework means engineers don't need to spend mental cycles. These cycles can be spent on the things critical to the identity of the specific project they're working on, like architecture and business logic. | ||
|
||
Once this framework also provides JS components, engineers won't even need to _see_ CSS -- it will be encapsulated behind the JS components' interfaces. | ||
|
||
### More UI tests === fewer UI bugs | ||
|
||
By covering our UI components with great unit tests and having those tests live within the framework itself, we can rest assured that our UI layer is tested and remove some of that burden from out integration/end-to-end tests. | ||
|
||
## Why not just use Bootstrap? | ||
|
||
In short: we've outgrown it! Third-party CSS frameworks like Bootstrap and Foundation are designed | ||
for a general audience, so they offer things we don't need and _don't_ offer things we _do_ need. | ||
As a result, we've forced to override their styles until the original framework is no longer | ||
recognizable. When the CSS reaches that point, it's time to take ownership over it and build | ||
your own framework. | ||
|
||
We also gain the ability to fix some of the common issues with third-party CSS frameworks: | ||
|
||
* They have non-semantic markup. | ||
* They deeply nest their selectors. | ||
|
||
For a more in-depth analysis of the problems with Bootstrap (and similar frameworks), check out this article and the links it has at the bottom: ["Bootstrap Bankruptcy"](http://www.matthewcopeland.me/blog/2013/11/04/bootstrap-bankruptcy/). | ||
|
||
## Examples of other in-house UI frameworks | ||
|
||
* [Ubiquiti CSS Framework](http://ubnt-css.herokuapp.com/#/app/popover) | ||
* [Smaato React UI Framework](http://smaato.github.io/ui-framework/#/modal) | ||
* [Lonely Planet Style Guide](http://rizzo.lonelyplanet.com/styleguide/design-elements/colours) | ||
* [MailChimp Patterns Library](http://ux.mailchimp.com/patterns) | ||
* [Salesforce Lightning Design System](https://www.lightningdesignsystem.com/) | ||
* [Refills](http://refills.bourbon.io/) | ||
* [Formstone](https://formstone.it/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF8"> | ||
<link href='https://fonts.googleapis.com/css?family=Lato:300,400,700|Ubuntu+Mono:400' rel='stylesheet' type='text/css'> | ||
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"> | ||
<script src="https://use.fontawesome.com/a9649923ac.js"></script> | ||
</head> | ||
<body> | ||
<div id="guide" style="height: 100%"></div> | ||
<script src="bundle.js"></script> | ||
</body> | ||
</html> |
48 changes: 48 additions & 0 deletions
48
src/ui_framework/src/framework/components/local_nav/_index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Normal colors | ||
$localNavTextColor: $textColor; | ||
$localNavBackgroundColor: #e4e4e4; | ||
$localNavButtonTextColor: #5a5a5a; | ||
$localNavButtonTextColor-isHover: #000000; | ||
$localNavButtonBackgroundColor: transparent; | ||
$localNavButtonBackgroundColor-isHover: rgba(#000000, 0.1); | ||
$localNavButtonBackgroundColor-isSelected: #f6f6f6; | ||
$localNavBreadcrumbDelimiterColor: #5a5a5a; | ||
$localSearchBackgroundColor: #ffffff; | ||
$localSearchBorderColor-isInvalid: #e74C3c; | ||
$localDropdownBackgroundColor: $localNavButtonBackgroundColor-isSelected; | ||
$localDropdownFormNoteTextColor: #737373; | ||
$localTabTextColor: $localNavButtonTextColor; | ||
$localTabTextColor-isHover: $localNavButtonTextColor-isHover; | ||
$localTabTextColor-isSelected: $localNavButtonTextColor-isHover; | ||
|
||
// Dark theme colors | ||
$localNavTextColor--darkTheme: $textColor--darkTheme; | ||
$localNavBackgroundColor--darkTheme: #333333; | ||
$localNavButtonTextColor--darkTheme: #dedede; | ||
$localNavButtonTextColor-isHover--darkTheme: #ffffff; | ||
$localNavButtonBackgroundColor-isHover--darkTheme: #000000; | ||
$localNavButtonBackgroundColor-isSelected--darkTheme: #525252; | ||
$localNavBreadcrumbDelimiterColor--darkTheme: #a5a5a5; | ||
$localSearchBackgroundColor--darkTheme: #4e4e4e; | ||
$localSearchBorderColor-isInvalid--darkTheme: #ff6758; | ||
$localDropdownBackgroundColor--darkTheme: $localNavButtonBackgroundColor-isSelected--darkTheme; | ||
$localDropdownFormNoteTextColor--darkTheme: #a2a2a2; | ||
$localDropdownWarningTextColor--darkTheme: $textColor--darkTheme; | ||
$localDropdownWarningBackgroundColor--darkTheme: #636363; | ||
$localTabTextColor--darkTheme: $localNavButtonTextColor--darkTheme; | ||
$localTabTextColor-isHover--darkTheme: $localNavButtonTextColor-isHover--darkTheme; | ||
$localTabTextColor-isSelected--darkTheme: $localNavButtonTextColor-isHover--darkTheme; | ||
|
||
// Spacing | ||
$localNavSideSpacing: 10px; | ||
|
||
// Font size | ||
$localNavFontSizeNormal: 14px; | ||
|
||
@import "local_breadcrumbs"; | ||
@import "local_dropdown"; | ||
@import "local_menu"; | ||
@import "local_nav"; | ||
@import "local_search"; | ||
@import "local_tabs"; | ||
@import "local_title"; |
58 changes: 58 additions & 0 deletions
58
src/ui_framework/src/framework/components/local_nav/_local_breadcrumbs.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
/** | ||
* 1. Breadcrumbs are placed in the top-left corner and need to be bumped over | ||
* a bit. | ||
*/ | ||
.localBreadcrumbs { | ||
display: flex; | ||
align-items: center; | ||
height: 100%; | ||
padding-left: $localNavSideSpacing; /* 1 */ | ||
} | ||
|
||
.localBreadcrumb { | ||
& + & { | ||
margin-left: 6px; | ||
|
||
&:before { | ||
content: '/'; | ||
user-select: none; | ||
margin-right: 4px; | ||
color: $localNavBreadcrumbDelimiterColor; | ||
|
||
@include darkTheme { | ||
color: $localNavBreadcrumbDelimiterColor--darkTheme; | ||
} | ||
} | ||
} | ||
|
||
&:last-child { | ||
.localBreadcrumb__link { | ||
pointer-events: none; | ||
color: $localNavTextColor; | ||
|
||
@include darkTheme { | ||
color: $localNavTextColor--darkTheme; | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
.localBreadcrumb__link { | ||
font-size: $localNavFontSizeNormal; | ||
color: #5a5a5a; | ||
text-decoration: none; | ||
|
||
&:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
@include darkTheme { | ||
color: $localNavButtonTextColor--darkTheme; | ||
} | ||
} | ||
|
||
.localBreadcrumb__emphasis { | ||
font-weight: 700; | ||
} |
Oops, something went wrong.