This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fab): Enable padding customization (#2959)
- This change enables users to customize Extended FAB icon & label padding using new mixins. - Updated the paddings as per updated design spec. - Updated styles to support text label followed by icon Extended FAB. - Added screenshot tests for mixins.
- Loading branch information
Showing
9 changed files
with
183 additions
and
13 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
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,18 @@ | ||
// | ||
// Copyright 2018 Google Inc. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
$mdc-fab-extended-icon-padding: 12px; | ||
$mdc-fab-extended-label-padding: 20px; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Copyright 2018 Google Inc. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
@import "../../../packages/mdc-fab/mixins"; | ||
|
||
.custom-fab-extended-padding-and-icon-size { | ||
@include mdc-fab-extended-padding(12px, 24px); | ||
@include mdc-fab-icon-size(32px); | ||
} | ||
|
||
.custom-fab-extended-padding { | ||
@include mdc-fab-extended-padding(16px, 24px); | ||
} | ||
|
||
.custom-fab-extended-label-padding { | ||
@include mdc-fab-extended-label-padding(24px); | ||
} |
51 changes: 51 additions & 0 deletions
51
test/screenshot/mdc-fab/mixins/mdc-fab-extended-label-padding.html
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 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
Copyright 2018 Google Inc. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License | ||
--> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Extended FAB (Floating Action Button) - MDC Web Screenshot Test</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="../../out/fixture.css"> | ||
<link rel="stylesheet" href="../../out/mdc.fab.css"> | ||
<link rel="stylesheet" href="../../out/mdc-fab/fixture.css"> | ||
<link rel="stylesheet" href="../../out/mdc-fab/custom.css"> | ||
</head> | ||
|
||
<body class="test-body"> | ||
<main class="test-main test-main--fab"> | ||
<div class="test-grid"> | ||
<div class="test-cell test-cell--extended"> | ||
<button class="mdc-fab mdc-fab--extended custom-fab-extended-padding-and-icon-size" aria-label="Create"> | ||
<span class="material-icons mdc-fab__icon">add</span> | ||
<span class="mdc-fab__label">Create</span> | ||
</button> | ||
</div> | ||
<div class="test-cell test-cell--extended"> | ||
<button class="mdc-fab mdc-fab--extended custom-fab-extended-padding" aria-label="Create"> | ||
<span class="mdc-fab__label">Create</span> | ||
<span class="material-icons mdc-fab__icon">add</span> | ||
</button> | ||
</div> | ||
<div class="test-cell test-cell--extended"> | ||
<button class="mdc-fab mdc-fab--extended custom-fab-extended-label-padding" aria-label="Create"> | ||
<span class="mdc-fab__label">Create</span> | ||
</button> | ||
</div> | ||
</div> | ||
</main> | ||
</body> | ||
</html> |