This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(divider): add implementation of the divider component
This commit adds an implementation of the "divider" component which groups and separates content within lists and page layouts using strong visual and spatial distinctions. Demos and docs accompany the implementation. Closes #194. Closes #250.
- Loading branch information
1 parent
11ed42c
commit e3aceea
Showing
12 changed files
with
174 additions
and
15 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
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 @@ | ||
Dividers, created with the `<material-divider>` directive. |
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,5 +1,9 @@ | ||
material-divider { | ||
display: block; | ||
border-bottom: 1px solid #d2d2d2; | ||
margin-top: 5px; | ||
} | ||
border-top: 1px solid $color-divider; | ||
margin: 0; | ||
|
||
&[inset] { | ||
margin-left: $baseline-grid * 10; | ||
} | ||
} |
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,51 @@ | ||
<div ng-app="app" ng-controller="AppCtrl"> | ||
|
||
<material-toolbar class="material-theme-light"> | ||
<h1 class="material-toolbar-tools"> | ||
<span>Full Bleed</span> | ||
</h1> | ||
</material-toolbar> | ||
|
||
<material-content> | ||
<material-list> | ||
<material-item ng-repeat="item in messages"> | ||
<material-item-content> | ||
<div class="material-tile-content"> | ||
<h2>{{item.what}}</h2> | ||
<h3>{{item.who}}</h3> | ||
<p> | ||
{{item.notes}} | ||
</p> | ||
</div> | ||
</material-item-content> | ||
<material-divider ng-if="!$last"></material-divider> | ||
</material-item> | ||
</material-list> | ||
</material-content> | ||
|
||
<material-toolbar class="material-theme-light"> | ||
<h1 class="material-toolbar-tools"> | ||
<span>Inset</span> | ||
</h1> | ||
</material-toolbar> | ||
|
||
<material-content> | ||
<material-list> | ||
<material-item ng-repeat="item in messages"> | ||
<material-item-content> | ||
<div class="material-tile-left"> | ||
<img ng-src="{{item.face}}" class="face" alt="{{item.who}}"> | ||
</div> | ||
<div class="material-tile-content"> | ||
<h2>{{item.what}}</h2> | ||
<h3>{{item.who}}</h3> | ||
<p> | ||
{{item.notes}} | ||
</p> | ||
</div> | ||
</material-item-content> | ||
<material-divider inset ng-if="!$last"></material-divider> | ||
</material-item> | ||
</material-list> | ||
</material-content> | ||
</div> |
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,34 @@ | ||
angular.module('app', ['ngMaterial']) | ||
.controller('AppCtrl', function($scope) { | ||
$scope.messages = [{ | ||
face: '/img/list/60.jpeg', | ||
what: 'Brunch this weekend?', | ||
who: 'Min Li Chan', | ||
when: '3:08PM', | ||
notes: " I'll be in your neighborhood doing errands" | ||
}, { | ||
face: '/img/list/60.jpeg', | ||
what: 'Brunch this weekend?', | ||
who: 'Min Li Chan', | ||
when: '3:08PM', | ||
notes: " I'll be in your neighborhood doing errands" | ||
}, { | ||
face: '/img/list/60.jpeg', | ||
what: 'Brunch this weekend?', | ||
who: 'Min Li Chan', | ||
when: '3:08PM', | ||
notes: " I'll be in your neighborhood doing errands" | ||
}, { | ||
face: '/img/list/60.jpeg', | ||
what: 'Brunch this weekend?', | ||
who: 'Min Li Chan', | ||
when: '3:08PM', | ||
notes: " I'll be in your neighborhood doing errands" | ||
}, { | ||
face: '/img/list/60.jpeg', | ||
what: 'Brunch this weekend?', | ||
who: 'Min Li Chan', | ||
when: '3:08PM', | ||
notes: " I'll be in your neighborhood doing errands" | ||
}]; | ||
}); |
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,6 @@ | ||
.face { | ||
border-radius: 30px; | ||
border: 1px solid #ddd; | ||
width: 48px; | ||
margin: 16px; | ||
} |
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,37 @@ | ||
/** | ||
* @ngdoc module | ||
* @name material.components.divider | ||
* @description Divider module! | ||
*/ | ||
angular.module('material.components.divider', [ | ||
'material.animations', | ||
'material.services.aria' | ||
]) | ||
.directive('materialDivider', MaterialDividerDirective); | ||
|
||
function MaterialDividerController(){} | ||
|
||
/** | ||
* @ngdoc directive | ||
* @name materialDivider | ||
* @module material.components.divider | ||
* @restrict E | ||
* | ||
* @description | ||
* Dividers group and separate content within lists and page layouts using strong visual and spatial distinctions. This divider is a thin rule, lightweight enough to not distract the user from content. | ||
* | ||
* @param {boolean=} inset Add this attribute to activate the inset divider style. | ||
* @usage | ||
* <hljs lang="html"> | ||
* <material-divider></material-divider> | ||
* | ||
* <material-divider inset></material-divider> | ||
* </hljs> | ||
* | ||
*/ | ||
function MaterialDividerDirective() { | ||
return { | ||
restrict: 'E', | ||
controller: [MaterialDividerController] | ||
}; | ||
} |
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,10 @@ | ||
{ | ||
"module": "material.components.divider", | ||
"name": "Divider", | ||
"demos": { | ||
"demo1": { | ||
"name": "Divider Usage", | ||
"files": ["demo1/*"] | ||
} | ||
} | ||
} |
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
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