-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Migrate UI Framework source into Kibana. #9192
Merged
cjcenizal
merged 5 commits into
elastic:master
from
cjcenizal:8867/feature/absorb-ui-framework
Dec 13, 2016
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
de3f34f
Migrate UI Framework source into Kibana.
cjcenizal 4e54844
Refactor UI Framework directory structure.
cjcenizal 43854bc
Remove babel-polyfill.
cjcenizal fe5bab1
Fix typos and include SCSS synchronously.
cjcenizal a44140a
Update with latest changes to UI Framework.
cjcenizal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/doc_site/build/*.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/components/index.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 been 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't you make this? 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure did! |
||
* [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,27 @@ | ||
// Normal colors | ||
$textColor: #2d2d2d; | ||
$buttonTextColor: #ffffff; | ||
$buttonBackgroundColor: #9c9c9c; | ||
$linkColor: #328CAA; | ||
$linkColor-isHover: #105A73; | ||
$inputTextColor: $textColor; | ||
$inputBackgroundColor: #ffffff; | ||
$inputBorderColor: $inputBackgroundColor; | ||
|
||
// Dark theme colors | ||
$textColor--darkTheme: #cecece; | ||
$buttonTextColor--darkTheme: #ffffff; | ||
$buttonBackgroundColor--darkTheme: #777777; | ||
$linkColor--darkTheme: #b7e2ea; | ||
$linkColor-isHover--darkTheme: #def2f6; | ||
$inputTextColor--darkTheme: $textColor--darkTheme; | ||
$inputBackgroundColor--darkTheme: #444444; | ||
$inputBorderColor--darkTheme: $inputBackgroundColor--darkTheme; | ||
|
||
@mixin darkTheme() { | ||
.theme-dark & { | ||
@content; | ||
} | ||
} | ||
|
||
@import "local_nav/index"; |
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"; |
62 changes: 62 additions & 0 deletions
62
src/ui_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,62 @@ | ||
|
||
/** | ||
* 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 { | ||
color: $localNavTextColor; | ||
cursor: default; | ||
|
||
&:hover { | ||
text-decoration: none; | ||
} | ||
|
||
@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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8080 is a common, and the default port for webpack dev server. We will probably want to change this in the future to avoid collisions.