├── .gitignore
├── LICENSE
├── README.md
├── docs
├── index.html
└── style.css
├── icons
├── icon128.png
├── icon16.png
├── icon19.png
├── icon48.png
└── icon512.png
├── images
├── arrow_drop_down_black_20dp.png
├── btw_ic_done_black_24dp_2x.png
├── btw_ic_pin_black_24dp_2x.png
├── btw_ic_snooze_black_24dp_2x.png
├── btw_ic_speeddial_compose_white_24dp_2x.png
├── btw_ic_speeddial_reminders_white_24dp_2x.png
├── btw_ic_speeddial_white_24dp_2x.png
├── calendar_event_attachment.png
├── cleardot.gif
├── favicon.png
├── grade_black_24dp.png
├── hangout_black_24dp.png
├── ic-mark-pinned-blue-24dp-r4-2x.png
├── ic-mark-pinned-green-24dp-r4-2x.png
├── ic-mark-pinned-orange-24dp-r4-2x.png
├── ic-mark-pinned-purple-24dp-r4-2x.png
├── ic-mark-pinned-red-24dp-r4-2x.png
├── ic-mark-pinned-yellow-24dp-r4-2x.png
├── ic-mark-red-bang-clr-24dp-r4-2x.png
├── ic_custom-cluster_24px_g60_r3_2x.png
├── ic_done_clr_24dp_r4_2x.png
├── ic_draft_g60_24dp_r2_2x.png
├── ic_finance_24px_clr_r3_2x.png
├── ic_forums_24px_clr_r3_2x.png
├── ic_mark-pinned_clr_24dp_r4_2x.png
├── ic_offers_24px_clr_r3_2x.png
├── ic_purchases_24px_clr_r3_2x.png
├── ic_reminder_blue_24dp_r2_2x.png
├── ic_sent_right_g60_24dp_r1_2x.png
├── ic_social_24px_clr_r3_2x.png
├── ic_spam_g60_24dp_r2_2x.png
├── ic_trash_g60_24dp_r2_2x.png
├── ic_travel_clr_24dp_r1_2x.png
├── ic_upcoming_clr_24dp_r5_2x.png
├── ic_updates_24px_clr_r3_2x.png
├── ic_zero_inbox_2x.png
├── inbox_googblue_24dp.png
└── label_important_black_24dp.png
├── manifest.json
├── screenshots
├── inbox v0.4.4.png
├── inbox v0.4.8-2.png
├── inbox v0.4.8-3.png
└── options v0.4.8-2.png
└── src
├── background.js
├── options
├── options.html
├── script.js
└── style.css
├── script.js
└── style.css
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | *.iml
3 | .DS_Store
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Team Inbox Rebuilders
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Inbox Reborn theme for Gmail™
2 | #### *Formerly known as Inbox in Gmail*
3 |
4 | Web extension which modifies Gmail™ to bring back the features and uncluttered design you knew and loved from Google's discontinued Inbox
5 |
6 | 
7 |
8 | ## Installing
9 |
10 | ### Chrome
11 |
12 | **NOTE**: This extension been removed from the Chrome Web Store for unknown reasons, see [issue #69](https://github.com/boukestam/inbox-in-gmail/issues/69)
13 |
14 | CRX file for Chrome available in [this repo's Releases page](https://github.com/boukestam/inbox-in-gmail/releases)
15 |
16 | If the CRX file does not work directly, try loading Inbox Reborn as an **unpacked extension**:
17 | 1. Download [this repo's source code here](https://github.com/boukestam/inbox-in-gmail/archive/master.zip), and unzip it where you like
18 | 2. Go to Chrome's extension settings page, at `chrome://extensions`
19 | 3. Tick the `Developer mode` checkbox on the top right of the page
20 | 4. Click the `Load unpacked` button, then select the unzipped folder you downloaded earlier
21 |
22 |
23 | ### Firefox
24 |
25 | [Firefox Add-ons: Inbox in Gmail](https://addons.mozilla.org/firefox/addon/inbox-in-gmail)
26 |
27 |
28 | ## Features
29 |
30 | - Bundle emails by label and category
31 | - Group emails by date (today, yesterday, this month, etc)
32 | - Clean interface to return to the simplicity of Inbox
33 | - Display emails sent to yourself with subject "Reminder" as reminders
34 | - Colored avatars based on senders name
35 | - Calendar events displayed in a small card, with inline responses
36 |
37 |
38 | ## Extension Options
39 |
40 | 
41 |
42 | Click the extension's icon at the top right of your browser to adjust the behavior of some features:
43 |
44 | #### Reminders
45 | This option is used to determine how to treat emails sent to yourself.
46 |
47 | - All are treated as reminders.
48 | - Only emails with a subject containing the word "reminder" are treated as reminders.
49 | - Leave the emails as they are. (Disable)
50 |
51 | #### Email Bundling
52 | This option is used to bundle emails by label in the inbox.
53 |
54 | - Toggle Enable/Disable
55 |
56 | #### Email Avatars
57 | This option will show a circle with the first letter initial of the sender, to the left of the email in your folder.
58 | - Toggle Enable/Disable
59 |
60 |
61 | ## Recommended Gmail™ Settings
62 |
63 | Using these settings will more closely replicate the visual style of Inbox:
64 |
65 | - Settings/Inbox/Categories -> Leave only Primary ticked
66 | - Settings/Inbox/Inbox Type -> Default or Starred First
67 | - Settings/Advanced/Multiple Inbox -> Disabled
68 | - Settings/Advanced/Preview Pane -> Disabled
69 | - Settings/General/Maximum Page Size -> Show 100 conversations per page
70 | - Settings/General/Personal level indicators -> No indicators
71 | - Settings/Inbox/Importance markers -> No markers
72 |
73 |
74 | ## Email Bundling Tips
75 |
76 | Disable inbox category tabs:
77 | - Settings Dropdown/Configure Inbox -> Leave only Primary ticked -> Save
78 |
79 | Allow default category labels (Promotions, Social, Updates, Forums) to be bundled:
80 | - Settings/Labels/Categories/Show in message List -> Click show for each category
81 |
82 | If you'd like a specific label not to be bundled, create a label called 'Unbundled', and nest that label within it.
83 |
84 |
85 | ## Known Issues
86 |
87 | - This extension works best in English, because it relies on specific date formats.
88 | - This currently only supports Gmail™'s default theme. If you enable the Dark theme, you will experience white/invisible text and icons.
89 |
90 |
91 | ## Privacy
92 |
93 | - This extension does not make any external network requests.
94 | - This extension does not use any analytics platforms.
95 | - The code is open source, ready for you to audit.
96 |
97 | In other words, you are not being tracked, and your data is not leaving the page to be processed or stored anywhere else. This extension just sits as a layer on top of Gmail™, modifying the style and behavior of the page.
98 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Inbox Reborn
5 |
6 |
7 |
8 |
9 |
10 | Inbox Reborn theme for Gmail™
11 | Blah blah blah test
12 |
13 |
14 |
15 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 60px auto;
3 | width: 70%;
4 | }
--------------------------------------------------------------------------------
/icons/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/icons/icon128.png
--------------------------------------------------------------------------------
/icons/icon16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/icons/icon16.png
--------------------------------------------------------------------------------
/icons/icon19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/icons/icon19.png
--------------------------------------------------------------------------------
/icons/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/icons/icon48.png
--------------------------------------------------------------------------------
/icons/icon512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/icons/icon512.png
--------------------------------------------------------------------------------
/images/arrow_drop_down_black_20dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/arrow_drop_down_black_20dp.png
--------------------------------------------------------------------------------
/images/btw_ic_done_black_24dp_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/btw_ic_done_black_24dp_2x.png
--------------------------------------------------------------------------------
/images/btw_ic_pin_black_24dp_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/btw_ic_pin_black_24dp_2x.png
--------------------------------------------------------------------------------
/images/btw_ic_snooze_black_24dp_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/btw_ic_snooze_black_24dp_2x.png
--------------------------------------------------------------------------------
/images/btw_ic_speeddial_compose_white_24dp_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/btw_ic_speeddial_compose_white_24dp_2x.png
--------------------------------------------------------------------------------
/images/btw_ic_speeddial_reminders_white_24dp_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/btw_ic_speeddial_reminders_white_24dp_2x.png
--------------------------------------------------------------------------------
/images/btw_ic_speeddial_white_24dp_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/btw_ic_speeddial_white_24dp_2x.png
--------------------------------------------------------------------------------
/images/calendar_event_attachment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/calendar_event_attachment.png
--------------------------------------------------------------------------------
/images/cleardot.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/cleardot.gif
--------------------------------------------------------------------------------
/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/favicon.png
--------------------------------------------------------------------------------
/images/grade_black_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/grade_black_24dp.png
--------------------------------------------------------------------------------
/images/hangout_black_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/hangout_black_24dp.png
--------------------------------------------------------------------------------
/images/ic-mark-pinned-blue-24dp-r4-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic-mark-pinned-blue-24dp-r4-2x.png
--------------------------------------------------------------------------------
/images/ic-mark-pinned-green-24dp-r4-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic-mark-pinned-green-24dp-r4-2x.png
--------------------------------------------------------------------------------
/images/ic-mark-pinned-orange-24dp-r4-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic-mark-pinned-orange-24dp-r4-2x.png
--------------------------------------------------------------------------------
/images/ic-mark-pinned-purple-24dp-r4-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic-mark-pinned-purple-24dp-r4-2x.png
--------------------------------------------------------------------------------
/images/ic-mark-pinned-red-24dp-r4-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic-mark-pinned-red-24dp-r4-2x.png
--------------------------------------------------------------------------------
/images/ic-mark-pinned-yellow-24dp-r4-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic-mark-pinned-yellow-24dp-r4-2x.png
--------------------------------------------------------------------------------
/images/ic-mark-red-bang-clr-24dp-r4-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic-mark-red-bang-clr-24dp-r4-2x.png
--------------------------------------------------------------------------------
/images/ic_custom-cluster_24px_g60_r3_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_custom-cluster_24px_g60_r3_2x.png
--------------------------------------------------------------------------------
/images/ic_done_clr_24dp_r4_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_done_clr_24dp_r4_2x.png
--------------------------------------------------------------------------------
/images/ic_draft_g60_24dp_r2_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_draft_g60_24dp_r2_2x.png
--------------------------------------------------------------------------------
/images/ic_finance_24px_clr_r3_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_finance_24px_clr_r3_2x.png
--------------------------------------------------------------------------------
/images/ic_forums_24px_clr_r3_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_forums_24px_clr_r3_2x.png
--------------------------------------------------------------------------------
/images/ic_mark-pinned_clr_24dp_r4_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_mark-pinned_clr_24dp_r4_2x.png
--------------------------------------------------------------------------------
/images/ic_offers_24px_clr_r3_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_offers_24px_clr_r3_2x.png
--------------------------------------------------------------------------------
/images/ic_purchases_24px_clr_r3_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_purchases_24px_clr_r3_2x.png
--------------------------------------------------------------------------------
/images/ic_reminder_blue_24dp_r2_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_reminder_blue_24dp_r2_2x.png
--------------------------------------------------------------------------------
/images/ic_sent_right_g60_24dp_r1_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_sent_right_g60_24dp_r1_2x.png
--------------------------------------------------------------------------------
/images/ic_social_24px_clr_r3_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_social_24px_clr_r3_2x.png
--------------------------------------------------------------------------------
/images/ic_spam_g60_24dp_r2_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_spam_g60_24dp_r2_2x.png
--------------------------------------------------------------------------------
/images/ic_trash_g60_24dp_r2_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_trash_g60_24dp_r2_2x.png
--------------------------------------------------------------------------------
/images/ic_travel_clr_24dp_r1_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_travel_clr_24dp_r1_2x.png
--------------------------------------------------------------------------------
/images/ic_upcoming_clr_24dp_r5_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_upcoming_clr_24dp_r5_2x.png
--------------------------------------------------------------------------------
/images/ic_updates_24px_clr_r3_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_updates_24px_clr_r3_2x.png
--------------------------------------------------------------------------------
/images/ic_zero_inbox_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/ic_zero_inbox_2x.png
--------------------------------------------------------------------------------
/images/inbox_googblue_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/inbox_googblue_24dp.png
--------------------------------------------------------------------------------
/images/label_important_black_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/images/label_important_black_24dp.png
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Inbox Reborn theme for Gmail™",
3 | "version": "0.5.5",
4 | "manifest_version": 2,
5 | "description": "Adds features like reminders, email bundling and Inbox's minimalistic style to Gmail™",
6 | "homepage_url": "https://github.com/team-inbox/inbox-reborn",
7 | "browser_action": {
8 | "default_popup": "src/options/options.html"
9 | },
10 | "options_ui": {
11 | "page": "src/options/options.html",
12 | "open_in_tab": false
13 | },
14 | "background": {
15 | "scripts": ["src/background.js"],
16 | "persistent": false
17 | },
18 | "permissions": [
19 | "storage"
20 | ],
21 | "icons": {
22 | "16": "icons/icon16.png",
23 | "48": "icons/icon48.png",
24 | "128": "icons/icon128.png"
25 | },
26 | "content_scripts": [
27 | {
28 | "matches": [
29 | "https://mail.google.com/*"
30 | ],
31 | "css": [
32 | "src/style.css"
33 | ],
34 | "js": [
35 | "src/script.js"
36 | ],
37 | "run_at": "document_start"
38 | }
39 | ],
40 | "web_accessible_resources": [
41 | "images/*"
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/screenshots/inbox v0.4.4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/screenshots/inbox v0.4.4.png
--------------------------------------------------------------------------------
/screenshots/inbox v0.4.8-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/screenshots/inbox v0.4.8-2.png
--------------------------------------------------------------------------------
/screenshots/inbox v0.4.8-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/screenshots/inbox v0.4.8-3.png
--------------------------------------------------------------------------------
/screenshots/options v0.4.8-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/windev0609/inbox-gmail/4882db819d4c6fa2fd3147ac04470c8c327e4901/screenshots/options v0.4.8-2.png
--------------------------------------------------------------------------------
/src/background.js:
--------------------------------------------------------------------------------
1 | chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
2 | if (request.method === 'getOptions') {
3 | const options = JSON.parse(localStorage.getItem('options') || '{}');
4 | options.reminderTreatment = options.reminderTreatment || 'containing-word';
5 | options.emailBundling = options.emailBundling || 'enabled';
6 | options.showAvatar = options.showAvatar || 'enabled';
7 |
8 | sendResponse(options);
9 | } else sendResponse({});
10 | });
--------------------------------------------------------------------------------
/src/options/options.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Inbox In Gmail Options
4 |
5 |
6 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/src/options/script.js:
--------------------------------------------------------------------------------
1 | const REMINDER_TREATMENT_SELECTOR = 'input[name=reminder-treatment]';
2 | const BUNDLED_EMAIL_SELECTOR = 'input[name=email-bundling]';
3 | const AVATAR_SELECTOR = 'input[name=avatar]';
4 |
5 | function saveOptions() {
6 | const reminderTreatment = getSelectedRadioValue(REMINDER_TREATMENT_SELECTOR);
7 | const emailBundling = getSelectedRadioValue(BUNDLED_EMAIL_SELECTOR);
8 | const showAvatar = getSelectedRadioValue(AVATAR_SELECTOR);
9 |
10 | const options = { reminderTreatment, emailBundling, showAvatar };
11 |
12 | localStorage.setItem('options', JSON.stringify(options));
13 | }
14 |
15 | function restoreOptions() {
16 | chrome.runtime.sendMessage({ method: 'getOptions' }, function(options) {
17 | selectRadioWithValue(REMINDER_TREATMENT_SELECTOR, options.reminderTreatment);
18 | selectRadioWithValue(BUNDLED_EMAIL_SELECTOR, options.emailBundling);
19 | selectRadioWithValue(AVATAR_SELECTOR, options.showAvatar);
20 | });
21 | }
22 |
23 | function selectRadioWithValue(selector, value) {
24 | document.querySelectorAll(selector).forEach(radioInput => {
25 | if(radioInput.value === value) radioInput.checked = true;
26 | });
27 | }
28 |
29 | const getSelectedRadioValue = selector => document.querySelector(selector + ':checked').value;
30 |
31 | const monitorChange = element => element.addEventListener('click', saveOptions);
32 |
33 | document.addEventListener('DOMContentLoaded', restoreOptions);
34 | document.querySelectorAll(REMINDER_TREATMENT_SELECTOR).forEach(monitorChange);
35 | document.querySelectorAll(BUNDLED_EMAIL_SELECTOR).forEach(monitorChange);
36 | document.querySelectorAll(AVATAR_SELECTOR).forEach(monitorChange);
37 |
--------------------------------------------------------------------------------
/src/options/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: rgb(242, 242, 242);
3 | font-family: Roboto, system-ui, sans-serif;
4 | font-size: 13px;
5 | margin: 0;
6 | }
7 |
8 | h1 {
9 | font-size: 1.5em;
10 | margin: 0 0 20px 0;
11 | }
12 |
13 | .content {
14 | box-shadow: rgb(224, 224, 224) 0px -1px 0px, rgba(0, 0, 0, 0.12) 0px 0px 2px, rgba(0, 0, 0, 0.24) 0px 2px 4px !important;
15 | background-color: white;
16 | padding: 0 20px;
17 | width: 550px;
18 | }
19 |
20 | .settings-wrapper {
21 | margin-top: 36px;
22 | }
23 |
24 | .setting {
25 | padding: 12px 20px;
26 | border-bottom: 1px solid rgb(224, 224, 224);
27 | margin: 0 -20px;
28 | }
29 |
30 | .setting-title {
31 | font-weight: bold;
32 | margin-bottom: 5px;
33 | }
34 |
35 | .setting-content {
36 | color: #616161;
37 | }
38 |
39 | button.save {
40 | float: right;
41 | font-size: 14px;
42 | margin-top: 12px;
43 |
44 | color: #fff;
45 | background-color: #007bff;
46 | border-color: #007bff;
47 | border-radius: .25rem;
48 | padding: .375rem .75rem;
49 | }
50 |
51 | .clearfix::after {
52 | content: "";
53 | clear: both;
54 | display: table;
55 | }
56 |
--------------------------------------------------------------------------------
/src/script.js:
--------------------------------------------------------------------------------
1 | const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
2 | const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
3 |
4 | const nameColors = ['1bbc9b','16a086','f1c40f','f39c11','2dcc70','27ae61','d93939','d25400','3598db','297fb8','e84c3d','c1392b','9a59b5','8d44ad','bec3c7','34495e','2d3e50','95a5a4','7e8e8e','ec87bf','d870ad','f69785','9ba37e','b49255','b49255','a94136'];
5 |
6 | const REMINDER_EMAIL_CLASS = 'reminder';
7 | const CALENDAR_EMAIL_CLASS = 'calendar-event';
8 | const CALENDAR_ATTACHMENT_CLASS = 'calendar-attachment';
9 | const BUNDLE_PAGE_CLASS = 'bundle-page';
10 | const BUNDLE_WRAPPER_CLASS = 'bundle-wrapper';
11 | const UNREAD_BUNDLE_CLASS = 'contains-unread';
12 | const BUNDLED_EMAIL_CLASS = 'bundled-email';
13 | const BUNDLING_OPTION_CLASS = 'email-bundling-enabled';
14 | const UNBUNDLED_PARENT_LABEL = 'Unbundled';
15 | const UNBUNDLED_EMAIL_CLASS = 'unbundled-email';
16 | const AVATAR_EMAIL_CLASS = 'email-with-avatar';
17 | const AVATAR_CLASS = 'avatar';
18 | const AVATAR_OPTION_CLASS = 'show-avatar-enabled';
19 | const STYLE_NODE_ID_PREFIX = 'hide-email-';
20 |
21 | const DATE_LABELS = {
22 | TODAY: 'Today',
23 | YESTERDAY: 'Yesterday',
24 | THIS_MONTH: 'This month',
25 | LAST_YEAR: 'Last year'
26 | };
27 |
28 | let lastEmailCount = 0;
29 | let lastRefresh = new Date();
30 | let loadedMenu = false;
31 | let labelStats = {};
32 | let hiddenEmailIds = [];
33 | let options = {};
34 |
35 | /* remove element */
36 | Element.prototype.remove = function () {
37 | this.parentElement.removeChild(this);
38 | };
39 |
40 | const getMyEmailAddress = () => {
41 | if (document.querySelector('.gb_hb').innerText) return document.querySelector('.gb_hb').innerText;
42 | if (document.querySelector('.gb_lb').innerText) return document.querySelector('.gb_lb').innerText;
43 | if (document.querySelector('.gb_qb').innerText) return document.querySelector('.gb_qb').innerText;
44 | return '';
45 | }
46 |
47 | const getEmailParticipants = function (email) {
48 | return email.querySelectorAll('.yW span[email]');
49 | };
50 |
51 | const isReminder = function (email, myEmailAddress) {
52 | // if user doesn't want reminders treated special, then just return as though current email is not a reminder
53 | if (options.reminderTreatment === 'none') return false;
54 |
55 | const nameNodes = getEmailParticipants(email);
56 | let allNamesMe = true;
57 |
58 | if (nameNodes.length === 0) allNamesMe = false;
59 |
60 | for (const nameNode of nameNodes) {
61 | if (nameNode.getAttribute('email') !== myEmailAddress) allNamesMe = false;
62 | }
63 |
64 | if (options.reminderTreatment === 'all') {
65 | return allNamesMe;
66 | } else if (options.reminderTreatment === 'containing-word') {
67 | const titleNode = email.querySelector('.y6');
68 | return allNamesMe && titleNode && titleNode.innerText.match(/reminder/i);
69 | }
70 |
71 | return false;
72 | };
73 |
74 | const isCalendarEvent = function (email) {
75 | const node = email.querySelector('.aKS .aJ6');
76 | return node && node.innerText === 'RSVP';
77 | };
78 |
79 | const addDateLabel = function (email, label) {
80 | if (email.previousSibling && email.previousSibling.className === 'time-row') {
81 | if (email.previousSibling.innerText === label) return;
82 | email.previousSibling.remove();
83 | }
84 |
85 | const timeRow = document.createElement('div');
86 | timeRow.classList.add('time-row');
87 | const time = document.createElement('div');
88 | time.className = 'time';
89 | time.innerText = label;
90 | timeRow.appendChild(time);
91 |
92 | email.parentElement.insertBefore(timeRow, email);
93 | };
94 |
95 | const getRawDate = function (email) {
96 | const dateElement = email.querySelector('.xW.xY span');
97 | if (dateElement) return dateElement.getAttribute('title');
98 | };
99 |
100 | const getDate = function (rawDate) {
101 | if (rawDate) return new Date(rawDate);
102 | };
103 |
104 | const buildDateLabel = function (date) {
105 | let now = new Date();
106 | if (date === undefined) return;
107 |
108 | if (now.getFullYear() == date.getFullYear()) {
109 | if (now.getMonth() == date.getMonth()) {
110 | if (now.getDate() == date.getDate()) return DATE_LABELS.TODAY;
111 | if (now.getDate() - 1 == date.getDate()) return DATE_LABELS.YESTERDAY;
112 | return DATE_LABELS.THIS_MONTH;
113 | }
114 | return months[date.getMonth()];
115 | }
116 | if (now.getFullYear() - 1 == date.getFullYear()) return DATE_LABELS.LAST_YEAR;
117 |
118 | return date.getFullYear().toString();
119 | };
120 |
121 | const cleanupDateLabels = function () {
122 | document.querySelectorAll('.time-row').forEach(row => {
123 | // Delete any back to back date labels
124 | if (row.nextSibling && row.nextSibling.className === 'time-row') row.remove();
125 | // Check nextSibling recursively until reaching the next .time-row
126 | // If all siblings are .bundled-email, then hide row
127 | else if (isEmptyDateLabel(row)) row.hidden = true;
128 | });
129 | };
130 |
131 | const isEmptyDateLabel = function (row) {
132 | const sibling = row.nextSibling;
133 | if (!sibling) return true;
134 | else if (sibling.className === 'time-row') return true;
135 | else if (![...sibling.classList].includes('bundled-email')) return false;
136 | return isEmptyDateLabel(sibling);
137 | }
138 |
139 | const getBundledLabels = function () {
140 | return Array.from(document.querySelectorAll('.BltHke[role=main] .bundle-wrapper')).reduce((bundledLabels, el) => {
141 | bundledLabels[el.attributes.bundleLabel.value] = true;
142 | return bundledLabels;
143 | }, {});
144 | };
145 |
146 | const addEventAttachment = function (email) {
147 | if (email.querySelector('.' + CALENDAR_ATTACHMENT_CLASS)) return;
148 |
149 | let title = 'Calendar Event';
150 | let time = '';
151 | const titleNode = email.querySelector('.bqe, .bog');
152 | if (titleNode) {
153 | const titleFullText = titleNode.innerText;
154 | let matches = Array.from(titleFullText.matchAll(/[^:]*: ([^@]*)@(.*)/g))[0];
155 | if (matches) {
156 | title = matches[1].trim();
157 | time = matches[2].trim();
158 | }
159 | }
160 |
161 | // build calendar attachment, this is based on regular attachments we no longer
162 | // have access to inbox to see the full structure
163 | const span = document.createElement('span');
164 | span.appendChild(document.createTextNode('Attachment'));
165 | span.classList.add('bzB');
166 |
167 | const attachmentNameSpan = document.createElement('span');
168 | attachmentNameSpan.classList.add('event-title');
169 | attachmentNameSpan.appendChild(document.createTextNode(title));
170 |
171 | const attachmentTimeSpan = document.createElement('span');
172 | attachmentTimeSpan.classList.add('event-time');
173 | attachmentTimeSpan.appendChild(document.createTextNode(time));
174 |
175 | const attachmentContentWrapper = document.createElement('span');
176 | attachmentContentWrapper.classList.add('brg');
177 | attachmentContentWrapper.appendChild(attachmentNameSpan);
178 | attachmentContentWrapper.appendChild(attachmentTimeSpan);
179 |
180 | // Find Invitation Action
181 | const action = email.querySelector('.aKS');
182 | if (action) attachmentContentWrapper.appendChild(action);
183 |
184 | const imageSpan = document.createElement('span');
185 | imageSpan.classList.add('calendar-image');
186 |
187 | const attachmentCard = document.createElement('div');
188 | attachmentCard.classList.add('brc');
189 | attachmentCard.setAttribute('role', 'listitem');
190 | attachmentCard.setAttribute('title', title);
191 | attachmentCard.appendChild(imageSpan);
192 | attachmentCard.appendChild(attachmentContentWrapper);
193 |
194 | const attachmentNode = document.createElement('div');
195 | attachmentNode.classList.add('brd', CALENDAR_ATTACHMENT_CLASS);
196 | attachmentNode.appendChild(span);
197 | attachmentNode.appendChild(attachmentCard);
198 |
199 | const emailSubjectWrapper = email.querySelectorAll('.a4W');
200 | if (emailSubjectWrapper) emailSubjectWrapper[0].appendChild(attachmentNode);
201 | };
202 |
203 | const reloadOptions = () => {
204 | chrome.runtime.sendMessage({ method: 'getOptions' }, function (ops) {
205 | options = ops;
206 | });
207 |
208 | // Add option classes to body for css styling, removes avatars when disabled
209 | if (options.showAvatar === 'enabled' && !document.body.classList.contains(AVATAR_OPTION_CLASS)) {
210 | document.body.classList.add(AVATAR_OPTION_CLASS);
211 | } else if (options.showAvatar === 'disabled' && document.body.classList.contains(AVATAR_OPTION_CLASS)) {
212 | document.body.classList.remove(AVATAR_OPTION_CLASS);
213 | document.querySelectorAll('.' + AVATAR_EMAIL_CLASS).forEach(avatarEl => avatarEl.classList.remove(AVATAR_EMAIL_CLASS));
214 | // Remove avatar elements
215 | document.querySelectorAll('.' + AVATAR_CLASS).forEach(avatarEl => avatarEl.remove());
216 | }
217 |
218 | // Add option classes to body for css styling, and unbundle emails when disabled
219 | if (options.emailBundling === 'enabled' && !document.body.classList.contains(BUNDLING_OPTION_CLASS)) {
220 | document.body.classList.add(BUNDLING_OPTION_CLASS);
221 | } else if (options.emailBundling === 'disabled' && document.body.classList.contains(BUNDLING_OPTION_CLASS)) {
222 | document.body.classList.remove(BUNDLING_OPTION_CLASS);
223 | // Unbundle emails
224 | document.querySelectorAll('.' + BUNDLED_EMAIL_CLASS).forEach(emailEl => emailEl.classList.remove(BUNDLED_EMAIL_CLASS));
225 | // Remove bundle wrapper rows
226 | document.querySelectorAll('.' + BUNDLE_WRAPPER_CLASS).forEach(bundleEl => bundleEl.remove());
227 | }
228 | };
229 |
230 | const getLabels = function (email) {
231 | return Array.from(email.querySelectorAll('.ar .at')).map(el => el.attributes.title.value);
232 | };
233 |
234 | const getTabs = () => Array.from(document.querySelectorAll('.aKz')).map(el => el.innerText);
235 |
236 | const htmlToElements = function (html) {
237 | var template = document.createElement('template');
238 | template.innerHTML = html;
239 | return template.content.firstElementChild;
240 | };
241 |
242 | const addClassToEmail = (emailEl, klass) => emailEl.classList.add(klass);
243 |
244 | const addClassToBundle = (label, klass) => {
245 | const bundle = document.querySelector(`div[bundleLabel="${label}"]`);
246 | if (bundle && !(bundle.classList.contains(klass))) bundle.classList.add(klass);
247 | };
248 |
249 | const removeClassFromBundle = (label, klass) => {
250 | const bundle = document.querySelector(`div[bundleLabel="${label}"]`);
251 | if (bundle && (bundle.classList.contains(klass))) bundle.classList.remove(klass);
252 | };
253 |
254 | const addCountToBundle = (label, count) => {
255 | const bundleLabel = document.querySelector(`div[bundleLabel="${label}"] .label-link`);
256 | if (!bundleLabel) return;
257 | const replacementHTML = `${label} (${count}) `;
258 | if (bundleLabel.innerHTML !== replacementHTML) bundleLabel.innerHTML = replacementHTML;
259 | };
260 |
261 | const addSendersToBundle = (label, senders) => {
262 | const bundleSenders = document.querySelector(`div[bundleLabel="${label}"] .bundle-senders`);
263 | if (!bundleSenders) return;
264 | let uniqueSenders = senders.reverse().filter((sender, index, self) => {
265 | if (self.findIndex(s => s.name === sender.name && s.isUnread === sender.isUnread) === index) {
266 | if (!sender.isUnread && self.findIndex(s => s.name === sender.name && s.isUnread) >= 0) return false;
267 | return true;
268 | };
269 | });
270 | const replacementHTML = `${uniqueSenders.map(sender => `${sender.name} `).join(', ')}`
271 | if (bundleSenders.innerHTML !== replacementHTML) bundleSenders.innerHTML = replacementHTML;
272 | };
273 |
274 | const getBundleImageForLabel = (label) => {
275 | switch (label) {
276 | case 'Promotions':
277 | return chrome.runtime.getURL('images/ic_offers_24px_clr_r3_2x.png');
278 | case 'Finance':
279 | return chrome.runtime.getURL('images/ic_finance_24px_clr_r3_2x.png');
280 | case 'Purchases':
281 | case 'Orders':
282 | return chrome.runtime.getURL('images/ic_purchases_24px_clr_r3_2x.png');
283 | case 'Trips':
284 | case 'Travel':
285 | return chrome.runtime.getURL('images/ic_travel_clr_24dp_r1_2x.png');
286 | case 'Updates':
287 | return chrome.runtime.getURL('images/ic_updates_24px_clr_r3_2x.png');
288 | case 'Forums':
289 | return chrome.runtime.getURL('images/ic_forums_24px_clr_r3_2x.png');
290 | case 'Social':
291 | return chrome.runtime.getURL('images/ic_social_24px_clr_r3_2x.png');
292 | default:
293 | return chrome.runtime.getURL('images/ic_custom-cluster_24px_g60_r3_2x.png');
294 | }
295 | };
296 |
297 | const getBundleTitleColorForLabel = (email, label) => {
298 | const labelEls = email.querySelectorAll('.at');
299 | let bundleTitleColor = null;
300 |
301 | labelEls.forEach((labelEl) => {
302 | if (labelEl.innerText === label) {
303 | const labelColor = labelEl.style.backgroundColor;
304 | // Ignore default label color, light gray
305 | if (labelColor !== 'rgb(221, 221, 221)') bundleTitleColor = labelColor;
306 | }
307 | });
308 |
309 | return bundleTitleColor;
310 | };
311 |
312 | const buildBundleWrapper = function (email, label, hasImportantMarkers) {
313 | const importantMarkerClass = hasImportantMarkers ? '' : 'hide-important-markers';
314 | const bundleImage = getBundleImageForLabel(label);
315 | const bundleTitleColor = bundleImage.match(/custom-cluster/) && getBundleTitleColorForLabel(email, label);
316 |
317 | const bundleWrapper = htmlToElements(`
318 |
319 |
320 |
321 |
322 |
323 |
${label}
324 |
325 |
326 |
327 |
328 |
329 | `);
330 |
331 | addClassToEmail(bundleWrapper, BUNDLE_WRAPPER_CLASS);
332 |
333 | bundleWrapper.onclick = () => location.href = `#search/in%3Ainbox+label%3A${fixLabel(label)}`;
334 |
335 | if (email && email.parentNode) email.parentElement.insertBefore(bundleWrapper, email);
336 | };
337 |
338 | const fixLabel = label => encodeURIComponent(label.replace(/[\/\\& ]/g, '-'));
339 |
340 | const isInInbox = () => document.querySelector('.nZ a[title=Inbox]') !== null;
341 |
342 | const isInBundle = () => document.location.hash.match(/#search\/in%3Ainbox\+label%3A/g) !== null;
343 |
344 | const checkImportantMarkers = () => document.querySelector('td.WA.xY');
345 |
346 | const checkEmailUnbundledLabel = labels => labels.filter(label => label.indexOf(UNBUNDLED_PARENT_LABEL) >= 0).length > 0;
347 |
348 | const getReadStatus = emailEl => emailEl.className.indexOf('zE') < 0;
349 |
350 | /**
351 | * If email has snooze data, return true.
352 | * Expects that the curDate should be larger than prevDate, if not, then also return true;
353 | */
354 | const isSnoozed = (email, curDate, prevDate) => {
355 | const node = email.querySelector('.by1.cL');
356 | if (node && node.innerText !== '') return true;
357 |
358 | return prevDate !== null && curDate < prevDate;
359 | };
360 |
361 | const isStarred = email => {
362 | const node = email.querySelector('.T-KT');
363 | if (node && node.title !== 'Not starred') return true;
364 | };
365 |
366 | /**
367 | * @return boolean true if email contains class
368 | */
369 | const checkEmailClass = (emailEl, klass) => emailEl.classList.contains(klass);
370 |
371 | const addClassToBody = (klass) => {
372 | if (!document.body.classList.contains(klass)) document.body.classList.add(klass);
373 | };
374 |
375 | const removeClassFromBody = (klass) => {
376 | if (document.body.classList.contains(klass)) document.body.classList.remove(klass);
377 | };
378 |
379 | const removeStyleNodeWithEmailId = (id) => {
380 | if (document.getElementById(STYLE_NODE_ID_PREFIX + id)) {
381 | hiddenEmailIds.splice(hiddenEmailIds.indexOf(id), 1);
382 | document.getElementById(STYLE_NODE_ID_PREFIX + id).remove();
383 | }
384 | }
385 |
386 | const createStyleNodeWithEmailId = (id) => {
387 | hiddenEmailIds.push(id);
388 |
389 | const style = document.createElement('style');
390 | document.head.appendChild(style);
391 | style.id = STYLE_NODE_ID_PREFIX + id;
392 | style.type = 'text/css';
393 | style.appendChild(document.createTextNode(`.nH.ar4.z [id="${id}"] { display: none; }`));
394 | };
395 |
396 | const getEmails = () => {
397 | const emails = document.querySelectorAll('.BltHke[role=main] .zA');
398 | const myEmailAddress = getMyEmailAddress();
399 | const isInInboxFlag = isInInbox();
400 | const isInBundleFlag = isInBundle();
401 | const processedEmails = [];
402 | const allLabels = new Set();
403 | const tabs = getTabs();
404 |
405 | let currentTab = tabs.length && document.querySelector('.aAy[aria-selected="true"]');
406 | let prevTimeStamp = null;
407 | labelStats = {};
408 |
409 | isInBundleFlag ? addClassToBody(BUNDLE_PAGE_CLASS) : removeClassFromBody(BUNDLE_PAGE_CLASS);
410 |
411 | // Start from last email on page and head towards first
412 | for (let i = emails.length - 1; i >= 0; i--) {
413 | let email = emails[i];
414 | let info = {};
415 | info.emailEl = email;
416 | info.isReminder = isReminder(email, myEmailAddress);
417 | info.reminderAlreadyProcessed = () => checkEmailClass(email, REMINDER_EMAIL_CLASS);
418 | info.dateString = getRawDate(email);
419 | info.date = getDate(info.dateString);
420 | info.dateLabel = buildDateLabel(info.date);
421 | info.isSnooze = isSnoozed(email, info.date, prevTimeStamp);
422 | info.isStarred = isStarred(email);
423 | // Only update prevTimeStamp if not snoozed, because we might have multiple snoozes back to back
424 | if (!info.isSnooze && info.date) prevTimeStamp = info.date;
425 | info.isCalendarEvent = isCalendarEvent(email);
426 | info.labels = getLabels(email);
427 | info.labels.forEach(l => allLabels.add(l));
428 |
429 | info.unbundledAlreadyProcessed = () => checkEmailClass(email, UNBUNDLED_EMAIL_CLASS);
430 | // Check for Unbundled parent label, mark row as unbundled
431 | info.isUnbundled = checkEmailUnbundledLabel(info.labels);
432 | if ((isInInboxFlag || isInBundleFlag) && info.isUnbundled && !info.unbundledAlreadyProcessed()) {
433 | addClassToEmail(email, UNBUNDLED_EMAIL_CLASS);
434 | info.emailEl.querySelectorAll('.ar.as').forEach(labelEl => {
435 | if (labelEl.querySelector('.at').title.indexOf(UNBUNDLED_PARENT_LABEL) >= 0) {
436 | // Remove 'Unbundled/' from display in the UI
437 | labelEl.querySelector('.av').innerText = labelEl.innerText.replace(UNBUNDLED_PARENT_LABEL + '/', '');
438 | } else {
439 | // Hide labels that aren't nested under UNBUNDLED_PARENT_LABEL
440 | labelEl.hidden = true;
441 | }
442 | });
443 | }
444 |
445 | // Check for labels used for Tabs, and hide them from the row.
446 | if ( false != currentTab ) {
447 | info.emailEl.querySelectorAll('.ar.as').forEach(labelEl => {
448 | if ( labelEl.innerText == currentTab.innerText ) {
449 | // Remove Tabbed labels from the row.
450 | labelEl.hidden = true;
451 | }
452 | });
453 | }
454 |
455 | info.isUnread = !getReadStatus(email);
456 |
457 | // Collect senders, message count and unread stats for each label
458 | if (info.labels.length) {
459 | const participants = Array.from(getEmailParticipants(email));
460 | const firstParticipant = participants[0].getAttribute('name');
461 | info.labels.forEach(label => {
462 | if (!(label in labelStats)) {
463 | labelStats[label] = {
464 | title: label,
465 | count: 1,
466 | senders: [{
467 | name: firstParticipant,
468 | isUnread: info.isUnread
469 | }]
470 | };
471 | } else {
472 | labelStats[label].count++;
473 | labelStats[label].senders.push({
474 | name: firstParticipant,
475 | isUnread: info.isUnread
476 | });
477 | }
478 | if (info.isUnread) labelStats[label].containsUnread = true;
479 | });
480 | }
481 |
482 | info.subjectEl = email.querySelector('.y6');
483 | info.subject = info.subjectEl && info.subjectEl.innerText.trim();
484 |
485 | info.isBundleEmail = () => checkEmailClass(email, BUNDLED_EMAIL_CLASS);
486 | info.isBundleWrapper = () => checkEmailClass(email, BUNDLE_WRAPPER_CLASS);
487 | info.avatarAlreadyProcessed = () => checkEmailClass(email, AVATAR_EMAIL_CLASS);
488 | info.bundleAlreadyProcessed = () => checkEmailClass(email, BUNDLED_EMAIL_CLASS) || checkEmailClass(email, BUNDLE_WRAPPER_CLASS);
489 | info.calendarAlreadyProcessed = () => checkEmailClass(email, CALENDAR_EMAIL_CLASS);
490 |
491 | processedEmails[i] = info;
492 | }
493 |
494 | // Update bundle stats
495 | for (label in labelStats) {
496 | // Set message count for each bundle row
497 | addCountToBundle(label, labelStats[label].count);
498 | // Set list of senders for each bundle row
499 | addSendersToBundle(label, labelStats[label].senders);
500 | // Set bold title class for any bundle containing an unread email
501 | labelStats[label].containsUnread ? addClassToBundle(label, UNREAD_BUNDLE_CLASS) : removeClassFromBundle(label, UNREAD_BUNDLE_CLASS);
502 | }
503 |
504 | return [processedEmails, allLabels];
505 | };
506 |
507 | const updateReminders = () => {
508 | reloadOptions();
509 | const [emails, allLabels] = getEmails();
510 | const myEmail = getMyEmailAddress();
511 | let lastLabel = null;
512 | let isInInboxFlag = isInInbox();
513 | let hasImportantMarkers = checkImportantMarkers();
514 | let tabs = getTabs();
515 |
516 | cleanupDateLabels();
517 | const emailBundles = getBundledLabels();
518 |
519 | for (const emailInfo of emails) {
520 | const emailEl = emailInfo.emailEl;
521 |
522 | if (emailInfo.isReminder && !emailInfo.reminderAlreadyProcessed()) { // skip if already added class
523 | if (emailInfo.subject.toLowerCase() === 'reminder') {
524 | emailInfo.subjectEl.outerHTML = '';
525 | emailEl.querySelectorAll('.Zt').forEach(node => node.outerHTML = '');
526 | emailEl.querySelectorAll('.y2').forEach(node => node.style.color = '#202124');
527 | }
528 | emailEl.querySelectorAll('.yP,.zF').forEach(node => { node.innerHTML = 'Reminder';});
529 |
530 | const avatarWrapperEl = emailEl.querySelector('.oZ-x3');
531 | if (avatarWrapperEl && avatarWrapperEl.getElementsByClassName(AVATAR_CLASS).length === 0) {
532 | const avatarElement = document.createElement('div');
533 | avatarElement.className = AVATAR_CLASS;
534 | avatarWrapperEl.appendChild(avatarElement);
535 | }
536 | addClassToEmail(emailEl, REMINDER_EMAIL_CLASS);
537 | } else if (options.showAvatar === 'enabled' && !emailInfo.reminderAlreadyProcessed() && !emailInfo.avatarAlreadyProcessed() && !emailInfo.bundleAlreadyProcessed()) {
538 | let participants = Array.from(getEmailParticipants(emailEl)); // convert to array to filter
539 | if (!participants.length) continue; // Prevents Drafts in Search or Drafts folder from causing errors
540 | let firstParticipant = participants[0];
541 |
542 | const excludingMe = participants.filter(node => node.getAttribute('email') !== myEmail && node.getAttribute('name'));
543 | // If there are others in the participants, use one of their initials instead
544 | if (excludingMe.length > 0) firstParticipant = excludingMe[0];
545 |
546 | const name = firstParticipant.getAttribute('name');
547 | const firstLetter = (name && name.toUpperCase()[0]) || '-';
548 | const targetElement = emailEl.querySelector('.oZ-x3');
549 |
550 | if (targetElement && targetElement.getElementsByClassName(AVATAR_CLASS).length === 0) {
551 | const avatarElement = document.createElement('div');
552 | avatarElement.className = AVATAR_CLASS;
553 | const firstLetterCode = firstLetter.charCodeAt(0);
554 |
555 | if (firstLetterCode >= 65 && firstLetterCode <= 90) {
556 | avatarElement.style.background = '#' + nameColors[firstLetterCode - 65];
557 | } else {
558 | avatarElement.style.background = '#000000';
559 | // Some unicode characters are not affected by 'color: white', hence this alternative
560 | avatarElement.style.color = 'transparent';
561 | avatarElement.style.textShadow = '0 0 rgba(255, 255, 255, 0.65)';
562 | }
563 |
564 | avatarElement.innerText = firstLetter;
565 | targetElement.appendChild(avatarElement);
566 | }
567 |
568 | addClassToEmail(emailEl, AVATAR_EMAIL_CLASS);
569 | }
570 |
571 | if (emailInfo.isCalendarEvent && !emailInfo.calendarAlreadyProcessed()) {
572 | addClassToEmail(emailEl, CALENDAR_EMAIL_CLASS);
573 | addEventAttachment(emailEl);
574 | }
575 |
576 | let label = emailInfo.dateLabel;
577 | // This is a hack for snoozed emails. If the snoozed email is the
578 | // first email, we just assume it arrived 'Today', any other snoozed email
579 | // joins whichever label the previous email had.
580 | if (emailInfo.isSnooze) label = (lastLabel == null) ? DATE_LABELS.TODAY : lastLabel;
581 |
582 | // Add date label if it's a new label
583 | if (label !== lastLabel) {
584 | addDateLabel(emailEl, label);
585 | lastLabel = label;
586 | }
587 |
588 | if (options.emailBundling === 'enabled') {
589 | // Remove bundles that no longer have associated emails
590 | if (emailInfo.isBundleWrapper() && !allLabels.has(emailEl.getAttribute('bundleLabel'))) {
591 | emailEl.remove();
592 | continue;
593 | }
594 |
595 | const labels = emailInfo.labels.filter(x => !tabs.includes(x));
596 | if (isInInboxFlag && !emailInfo.isStarred && labels.length && !emailInfo.isUnbundled && !emailInfo.bundleAlreadyProcessed()) {
597 | labels.forEach(label => {
598 | addClassToEmail(emailEl, BUNDLED_EMAIL_CLASS);
599 | // Insert style node to avoid bundled emails appearing briefly in inbox during redraw
600 | if (!hiddenEmailIds.includes(emailEl.id)) createStyleNodeWithEmailId(emailEl.id);
601 |
602 | if (!(label in emailBundles)) {
603 | buildBundleWrapper(emailEl, label, hasImportantMarkers);
604 | emailBundles[label] = true;
605 | }
606 | });
607 | } else if (!emailInfo.isUnbundled && !labels.length && hiddenEmailIds.includes(emailEl.id)) {
608 | removeStyleNodeWithEmailId(emailEl.id);
609 | }
610 | }
611 | }
612 | };
613 |
614 | /*
615 | **
616 | **START OF LEFT MENU
617 | **
618 | */
619 |
620 | const menuNodes = {};
621 | const setupMenuNodes = () => {
622 | const observer = new MutationObserver(() => {
623 | // menu items
624 | [
625 | { label: 'inbox', selector: '.aHS-bnt' },
626 | { label: 'snoozed', selector: '.aHS-bu1' },
627 | { label: 'done', selector: '.aHS-aHO' },
628 | { label: 'drafts', selector: '.aHS-bnq' },
629 | { label: 'sent', selector: '.aHS-bnu' },
630 | { label: 'spam', selector: '.aHS-bnv' },
631 | { label: 'trash', selector: '.aHS-bnx' },
632 | { label: 'starred', selector: '.aHS-bnw' },
633 | { label: 'important', selector: '.aHS-bns' },
634 | { label: 'chats', selector: '.aHS-aHP' },
635 | ].map(({ label, selector }) => {
636 | const node = queryParentSelector(document.querySelector(selector), '.aim');
637 | if (node) menuNodes[label] = node;
638 | });
639 | });
640 | observer.observe(document.body, { subtree: true, childList: true });
641 | };
642 |
643 | const reorderMenuItems = () => {
644 | const observer = new MutationObserver(() => {
645 | const parent = document.querySelector('.wT .byl');
646 | const refer = document.querySelector('.wT .byl>.TK');
647 | const { inbox, snoozed, done, drafts, sent, spam, trash, starred, important, chats } = menuNodes;
648 |
649 | if (parent && refer && loadedMenu && inbox && snoozed && done && drafts && sent && spam && trash && starred && important && chats) {
650 | // Gmail will execute its script to add element to the first child, so
651 | // add one placeholder for it and do the rest in the next child.
652 | const placeholder = document.createElement('div');
653 | placeholder.classList.add('TK');
654 | placeholder.style.cssText = 'padding: 0; border: 0;';
655 |
656 | // Assign link href which only show archived mail
657 | done.querySelector('a').href = '#archive';
658 |
659 | // Remove id attribute from done element for preventing event override from Gmail
660 | done.firstChild.removeAttribute('id');
661 |
662 | // Manually add on-click event to done elment
663 | done.addEventListener('click', () => window.location.assign('#archive'));
664 |
665 | // Rewrite text from All Mail to Done
666 | done.querySelector('a').innerText = 'Done';
667 |
668 | // Add border seperator to bottom of Done
669 | const innerDone = done.querySelector('div');
670 | innerDone.parentElement.style.borderBottom = '1px solid rgb(221, 221, 221)';
671 | innerDone.parentElement.style.paddingBottom = '15px';
672 | innerDone.style.paddingBottom = '5px';
673 | innerDone.style.paddingTop = '5px';
674 |
675 | const newNode = document.createElement('div');
676 | newNode.classList.add('TK');
677 | newNode.appendChild(inbox);
678 | newNode.appendChild(snoozed);
679 | newNode.appendChild(done);
680 | parent.insertBefore(placeholder, refer);
681 | parent.insertBefore(newNode, refer);
682 |
683 | setupClickEventForNodes([inbox, snoozed, done, drafts, sent, spam, trash, starred, important, chats]);
684 |
685 | // Close More menu
686 | document.body.querySelector('.J-Ke.n4.ah9').click();
687 | observer.disconnect();
688 | }
689 |
690 | if (!loadedMenu && inbox) {
691 | // Open More menu
692 | document.body.querySelector('.J-Ke.n4.ah9').click();
693 | loadedMenu = true;
694 | }
695 | });
696 | observer.observe(document.body, { subtree: true, childList: true });
697 | };
698 |
699 | const activateMenuItem = (target, nodes) => {
700 | nodes.map(node => node.firstChild.classList.remove('nZ'));
701 | target.firstChild.classList.add('nZ');
702 | };
703 |
704 | const setupClickEventForNodes = (nodes) => {
705 | nodes.map(node =>
706 | node.addEventListener('click', () =>
707 | activateMenuItem(node, nodes)
708 | )
709 | );
710 | };
711 |
712 | const queryParentSelector = (elm, sel) => {
713 | if (!elm) return null;
714 | var parent = elm.parentElement;
715 | while (!parent.matches(sel)) {
716 | parent = parent.parentElement;
717 | if (!parent) return null;
718 | }
719 | return parent;
720 | };
721 |
722 | /*
723 | **
724 | **END OF LEFT MENU
725 | **
726 | */
727 |
728 | const triggerMouseEvent = function (node, event) {
729 | const mouseUpEvent = document.createEvent('MouseEvents');
730 | mouseUpEvent.initEvent(event, true, true);
731 | node.dispatchEvent(mouseUpEvent);
732 | };
733 |
734 | const waitForElement = function (selector, callback, tries = 100) {
735 | const element = document.querySelector(selector);
736 | if (element) callback(element);
737 | else if (tries > 0) setTimeout(() => waitForElement(selector, callback, tries - 1), 100);
738 | };
739 |
740 | const handleHashChange = () => {
741 | let hash = window.location.hash;
742 | if (isInBundle()) hash = '#inbox';
743 | else hash = hash.split('/')[0].split('?')[0];
744 | const headerElement = document.querySelector('header').parentElement.parentElement;
745 | const titleNode = document.querySelector('a[title="Gmail"]:not([aria-label])');
746 |
747 | if (!titleNode || !headerElement) return;
748 |
749 | headerElement.setAttribute('pageTitle', hash.replace('#', ''));
750 | titleNode.href = hash;
751 | };
752 |
753 | window.addEventListener('hashchange', handleHashChange);
754 |
755 | document.addEventListener('DOMContentLoaded', function () {
756 | const addReminder = document.createElement('div');
757 | addReminder.className = 'add-reminder';
758 | addReminder.addEventListener('click', function () {
759 | const myEmail = getMyEmailAddress();
760 |
761 | // TODO: Replace all of the below with gmail.compose.start_compose() via the Gmail.js lib
762 | const composeButton = document.querySelector('.T-I.J-J5-Ji.T-I-KE.L3');
763 | triggerMouseEvent(composeButton, 'mousedown');
764 | triggerMouseEvent(composeButton, 'mouseup');
765 |
766 | // TODO: Delete waitForElement() function, replace with gmail.observe.on('compose') via the Gmail.js lib
767 | waitForElement('textarea[name=to]', to => {
768 | const title = document.querySelector('input[name=subjectbox]');
769 | const body = document.querySelector('div[aria-label="Message Body"]');
770 | const from = document.querySelector('input[name="from"]');
771 |
772 | from.value = myEmail;
773 | to.value = myEmail;
774 | title.value = 'Reminder';
775 | body.focus();
776 | });
777 | });
778 | document.body.appendChild(addReminder);
779 |
780 | waitForElement('a[title="Gmail"]:not([aria-label])', handleHashChange);
781 |
782 | const floatingComposeButton = document.createElement('div');
783 | floatingComposeButton.className = 'floating-compose';
784 | floatingComposeButton.addEventListener('click', function () {
785 | // TODO: Replace all of the below with gmail.compose.start_compose() via the Gmail.js lib
786 | const composeButton = document.querySelector('.T-I.J-J5-Ji.T-I-KE.L3');
787 | triggerMouseEvent(composeButton, 'mousedown');
788 | triggerMouseEvent(composeButton, 'mouseup');
789 | });
790 | document.body.appendChild(floatingComposeButton);
791 |
792 | setInterval(updateReminders, 250);
793 | });
794 |
795 | const setFavicon = () => document.querySelector('link[rel*="shortcut icon"]').href = chrome.runtime.getURL('images/favicon.png');;
796 |
797 | const init = () => {
798 | setFavicon();
799 | setupMenuNodes();
800 | reorderMenuItems();
801 | };
802 |
803 | if (document.head) init();
804 | else document.addEventListener('DOMContentLoaded', init);
805 |
--------------------------------------------------------------------------------
/src/style.css:
--------------------------------------------------------------------------------
1 | /* Change font everywhere */
2 | * {
3 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
4 | font-size: 99.1%;
5 | letter-spacing: normal;
6 | }
7 |
8 | /* Email subject colour */
9 | .zA {
10 | color: #040404;
11 | }
12 |
13 | /* Header bar */
14 | header {
15 | box-shadow: 0 0 4px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .28);
16 | }
17 |
18 | /* Sidebar: hide the label email counters */
19 | .bsU {
20 | display: none !important;
21 | }
22 |
23 | /* Sidebar: labels */
24 | .TO .nU > .n0,
25 | .ah9 > .CJ {
26 | color: #616161;
27 | }
28 |
29 | /* Sidebar: labels */
30 | .TO .nU > .n0,
31 | .TO.NQ .nU > .n0,
32 | .TO.nZ .nU > .n0,
33 | .ah9 > .CJ,
34 | .n3 > .CL > .CK {
35 | text-shadow: none;
36 | }
37 |
38 | /* Emails */
39 | .Cp {
40 | /*box-shadow: 0 -1px 0 #e0e0e0, 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.24);*/
41 | margin: auto !important;
42 | max-width: 1200px;
43 | padding: 0 10px;
44 | }
45 |
46 | /* Set opened email width to same as email list */
47 | .Bs.nH.iY.bAt {
48 | margin: 10px auto 10px auto !important;
49 | max-width: 1180px;
50 | padding: 0 10px;
51 | }
52 |
53 | /* Align toolbar with email width */
54 | .aeH > .G-atb {
55 | margin: auto !important;
56 | max-width: 1180px;
57 | }
58 |
59 | @media only screen and (min-width: 1420px) {
60 | .aeH > .G-atb {
61 | padding-left: 0;
62 | }
63 | }
64 |
65 | .aeH {
66 | margin-right: 7vw;
67 | }
68 |
69 | /* Enforce background color behind emails */
70 | .ar4 {
71 | background: #f2f2f2;
72 | }
73 |
74 | /* Attachment icon */
75 | .yE {
76 | display: none !important;
77 | }
78 |
79 | /* Star email */
80 | td.apU.xY {
81 | display: block;
82 | position: absolute;
83 | right: 0px;
84 | }
85 |
86 | /* Display star (pin) on hover */
87 | .zA:hover td.apU.xY {
88 | display: block;
89 | }
90 |
91 | /* Not starred image */
92 | td.apU.xY .T-KT::before {
93 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/btw_ic_pin_black_24dp_2x.png') !important;
94 | background-size: 24px !important;
95 | }
96 |
97 | /* Starred menu item */
98 | .aHS-bnw .qj {
99 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/btw_ic_pin_black_24dp_2x.png') !important;
100 | background-size: 24px !important;
101 | }
102 |
103 | /* Starred */
104 | td.apU.xY .T-KT.xl::before {
105 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/btw_ic_pin_black_24dp_2x.png') !important;
106 | background-size: 24px !important;
107 | }
108 |
109 | /* Starred - Yellow Star */
110 | td.apU.xY .T-KT.T-KT-Jp::before {
111 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic-mark-pinned-yellow-24dp-r4-2x.png') !important;
112 | background-size: 24px !important;
113 | opacity: 1;
114 | }
115 |
116 | /* Starred - Orange Star */
117 | td.apU.xY .T-KT.xl::before {
118 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic-mark-pinned-orange-24dp-r4-2x.png') !important;
119 | background-size: 24px !important;
120 | }
121 |
122 | /* Starred - Red Star */
123 | td.apU.xY .T-KT.xn::before {
124 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic-mark-pinned-red-24dp-r4-2x.png') !important;
125 | background-size: 24px !important;
126 | }
127 |
128 | /* Starred - Purple Star */
129 | td.apU.xY .T-KT.xm::before {
130 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic-mark-pinned-purple-24dp-r4-2x.png') !important;
131 | background-size: 24px !important;
132 | }
133 |
134 | /* Starred - Blue Star */
135 | td.apU.xY .T-KT.xj::before {
136 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic-mark-pinned-blue-24dp-r4-2x.png') !important;
137 | background-size: 24px !important;
138 | }
139 |
140 | /* Starred - Green Star */
141 | td.apU.xY .T-KT.xk::before {
142 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic-mark-pinned-green-24dp-r4-2x.png') !important;
143 | background-size: 24px !important;
144 | }
145 |
146 | /* Starred - Red Bang */
147 | td.apU.xY .T-KT.xg::before {
148 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
149 | background-size: 1px !important;
150 | }
151 |
152 | /* Starred - Orange Guillimet */
153 | td.apU.xY .T-KT.xe::before {
154 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
155 | background-size: 1px !important;
156 | }
157 |
158 | /* Starred - Yellow Bang */
159 | td.apU.xY .T-KT.xh::before {
160 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
161 | background-size: 1px !important;
162 | }
163 |
164 | /* Starred - Green Check */
165 | td.apU.xY .T-KT.xd::before {
166 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
167 | background-size: 1px !important;
168 | }
169 |
170 | /* Starred - Blue Info */
171 | td.apU.xY .T-KT.xc::before {
172 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
173 | background-size: 1px !important;
174 | }
175 |
176 | /* Starred - Purple Question */
177 | td.apU.xY .T-KT.xf::before {
178 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
179 | background-size: 1px !important;
180 | }
181 |
182 | @-moz-document url-prefix() {
183 | /* Not starred image */
184 | td.apU.xY .T-KT::before {
185 | background-image: url('moz-extension://__MSG_@@extension_id__/images/btw_ic_pin_black_24dp_2x.png') !important;
186 | }
187 | /* Starred menu item */
188 | .aHS-bnw .qj {
189 | background-image: url('moz-extension://__MSG_@@extension_id__/images/btw_ic_pin_black_24dp_2x.png') !important;
190 | }
191 | /* Starred */
192 | td.apU.xY .T-KT.xl::before {
193 | background-image: url('moz-extension://__MSG_@@extension_id__/images/btw_ic_pin_black_24dp_2x.png') !important;
194 | }
195 | /* Starred - Yellow Star */
196 | td.apU.xY .T-KT.T-KT-Jp::before {
197 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic-mark-pinned-yellow-24dp-r4-2x.png') !important;
198 | }
199 | /* Starred - Orange Star */
200 | td.apU.xY .T-KT.xl::before {
201 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic-mark-pinned-orange-24dp-r4-2x.png') !important;
202 | }
203 | /* Starred - Red Star */
204 | td.apU.xY .T-KT.xn::before {
205 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic-mark-pinned-red-24dp-r4-2x.png') !important;
206 | }
207 | /* Starred - Purple Star */
208 | td.apU.xY .T-KT.xm::before {
209 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic-mark-pinned-purple-24dp-r4-2x.png') !important;
210 | }
211 | /* Starred - Blue Star */
212 | td.apU.xY .T-KT.xj::before {
213 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic-mark-pinned-blue-24dp-r4-2x.png') !important;
214 | }
215 | /* Starred - Green Star */
216 | td.apU.xY .T-KT.xk::before {
217 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic-mark-pinned-green-24dp-r4-2x.png') !important;
218 | }
219 | /* Starred - Red Bang */
220 | td.apU.xY .T-KT.xg::before {
221 | background-image: url('moz-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
222 | }
223 | /* Starred - Orange Guillimet */
224 | td.apU.xY .T-KT.xe::before {
225 | background-image: url('moz-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
226 | }
227 | /* Starred - Yellow Bang */
228 | td.apU.xY .T-KT.xh::before {
229 | background-image: url('moz-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
230 | }
231 | /* Starred - Green Check */
232 | td.apU.xY .T-KT.xd::before {
233 | background-image: url('moz-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
234 | }
235 | /* Starred - Blue Info */
236 | td.apU.xY .T-KT.xc::before {
237 | background-image: url('moz-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
238 | }
239 | /* Starred - Purple Question */
240 | td.apU.xY .T-KT.xf::before {
241 | background-image: url('moz-extension://__MSG_@@extension_id__/images/cleardot.gif') !important;
242 | }
243 | }
244 |
245 | /* Unread email */
246 | .yO {
247 | background: #FFF !important;
248 | }
249 |
250 | /* Time */
251 | .time {
252 | color: #666;
253 | font-size: 14px;
254 | padding-bottom: 10px;
255 | padding-top: 20px;
256 | padding-left: 20px;
257 | }
258 |
259 | /* Email */
260 | .zA, .zA:hover {
261 | box-shadow: 0 -1px 0 #e0e0e0, 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.24) !important;
262 | -webkit-box-shadow: 0 -1px 0 #e0e0e0, 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.24) !important;
263 | z-index: inherit !important;
264 | padding-right: 24px;
265 | background: #FFF !important;
266 | }
267 |
268 | /* Inbox Email is Empty show Sun */
269 | .ar4.z .TD > .TC {
270 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic_zero_inbox_2x.png') !important;
271 | background-repeat: no-repeat;
272 | background-position: center;
273 | padding-top: 30px;
274 | height: 618px;
275 | width: 456px;
276 | background-color: #F2F2F2;
277 | color: transparent;
278 | font-size: 14px;
279 | }
280 | @-moz-document url-prefix() {
281 | .ar4.z .TD > .TC {
282 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic_zero_inbox_2x.png') !important;
283 | }
284 | }
285 |
286 | /* Fix for weird white space */
287 | .eb.TD {
288 | display: none;
289 | }
290 |
291 | /* Fix padding on search */
292 | .BltHke.nH.oy8Mbf {
293 | margin-top: 10px;
294 | }
295 |
296 | /* Hide border at bottom of empty inbox background */
297 | .cf.TB {
298 | border-bottom: none !important;
299 | }
300 |
301 | /*
302 | **
303 | **START OF LEFT MENU
304 | **
305 | */
306 |
307 | .aim {
308 | padding-left: 4px !important;
309 | }
310 |
311 | /* Menu item row */
312 | .TK .TO {
313 | border-radius: 2px !important;
314 | }
315 |
316 | /* Menu item row, hover */
317 | .TK .TO:hover {
318 | background-color: rgba(0,0,0,.05) !important;
319 | cursor: pointer;
320 | }
321 |
322 | /* Menu item row active */
323 | .TK .TO:active,
324 | .n6 .ah9.aiu:active
325 | .CL:active,
326 | .TO.nZ,
327 | .TO.NQ,
328 | .TO.ol {
329 | background-color: rgba(0,0,0,.05) !important;
330 | }
331 |
332 | /* Left sidebar collapsed */
333 | .aeN.bhZ {
334 | transform: translateX(-80px) !important;
335 | transition: transform 0.2s ease;
336 | }
337 |
338 | /* Done icon (green checkmark) */
339 | .byl > .TK:nth-of-type(2) > .aim:nth-of-type(3) .qj {
340 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic_done_clr_24dp_r4_2x.png') !important;
341 | }
342 |
343 | @-moz-document url-prefix() {
344 | /* Done icon (green checkmark) */
345 | .byl > .TK:nth-of-type(2) > .aim:nth-of-type(3) .qj {
346 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic_done_clr_24dp_r4_2x.png') !important;
347 | }
348 | }
349 |
350 | /* Compose email old place */
351 | .z0 {
352 | margin: 0px !important;
353 | height: 10px !important;
354 | }
355 |
356 | /* Compose email boxes wrapper */
357 | .nH.Hd {
358 | margin-right: 40px;
359 | }
360 |
361 | /* Hangout chat box wrapper */
362 | .nH.aJl.nn {
363 | margin-right: 40px;
364 | }
365 |
366 | /* Menu container */
367 | .aeN {
368 | width: 232px !important;
369 | max-width: unset !important;
370 | min-width: unset !important;
371 | left: 0;
372 | }
373 | .wT {
374 | margin-top: -20px;
375 | max-width: unset;
376 | min-width: unset;
377 | width: 224px;
378 | padding: 12px 8px 52px;
379 | }
380 |
381 | /* Menu item sections */
382 | .TK {
383 | padding: 8px 0;
384 | }
385 |
386 | /* Menu item row inner */
387 | .aim .TN {
388 | height: 40px;
389 | }
390 |
391 | /* Menu item row inner (when collapsed) */
392 | .bhZ:not(.bym) .TN {
393 | padding: 0 4px !important;
394 | }
395 |
396 | /* Menu item link */
397 | .TO .nU > .n0 {
398 | font-weight: normal;
399 | }
400 |
401 | /* Menu item link */
402 | .TO .nU > .n0 {
403 | font-weight: normal;
404 | }
405 |
406 | .wT > .n3 .byl:first-child .aim:first-child .nZ {
407 | background-color: rgba(0,0,0,.05) !important;
408 | }
409 | .qj {
410 | width: 24px !important;
411 | height: 24px !important;
412 | opacity: 1 !important;
413 | margin-right: 24px !important;
414 | background-size: 24px !important;
415 | }
416 | .qj::before {
417 | content: none !important;
418 | }
419 | .qj::after {
420 | content: none !important;
421 | }
422 | /* Inbox */
423 | .aHS-bnt .qj {
424 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/inbox_googblue_24dp.png') !important;
425 | }
426 | /* Dropdown arrow */
427 | .aHS-bnt .afM {
428 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/arrow_drop_down_black_20dp.png') !important;
429 | }
430 | /* Starred, Important, Chats */
431 | .aHS-bnw .qr,
432 | .aHS-bns .qr,
433 | .aHS-aHP .qr {
434 | opacity: 0.6 !important;
435 | }
436 | /* Starred */
437 | .aHS-bnw .qj {
438 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/grade_black_24dp.png') !important;
439 | }
440 | /* Important */
441 | .aHS-bns .qj {
442 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/label_important_black_24dp.png') !important;
443 | }
444 | /* Chats */
445 | .aHS-aHP .qj {
446 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/hangout_black_24dp.png') !important;
447 | }
448 | /* Snoozed */
449 | .aHS-bu1 .qj {
450 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic_upcoming_clr_24dp_r5_2x.png') !important;
451 | }
452 | /* Sent */
453 | .aHS-bnu .qj {
454 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic_sent_right_g60_24dp_r1_2x.png') !important;
455 | }
456 | /* Drafts */
457 | .aHS-bnq .qj {
458 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic_draft_g60_24dp_r2_2x.png') !important;
459 | }
460 | /* Trash */
461 | .aHS-bnx .qj {
462 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic_trash_g60_24dp_r2_2x.png') !important;
463 | }
464 | /* Category */
465 | .aHS-bnr .qj {
466 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic_custom-cluster_24px_g60_r3_2x.png') !important;
467 | background-repeat: repeat-x;
468 | padding: 12px;
469 | width: 48px;
470 | border: 3px solid #F2F2F2;
471 | box-sizing: border-box;
472 | border-radius: 30%;
473 | }
474 | /* Spam */
475 | .aHS-bnv .qj {
476 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/ic_spam_g60_24dp_r2_2x.png') !important;
477 | }
478 |
479 | @-moz-document url-prefix() {
480 | /* Inbox */
481 | .aHS-bnt .qj {
482 | background-image: url('moz-extension://__MSG_@@extension_id__/images/inbox_googblue_24dp.png') !important;
483 | }
484 | /* Dropdown arrow */
485 | .aHS-bnt .afM {
486 | background-image: url('moz-extension://__MSG_@@extension_id__/images/arrow_drop_down_black_20dp.png') !important;
487 | }
488 | /* Starred */
489 | .aHS-bnw .qj {
490 | background-image: url('moz-extension://__MSG_@@extension_id__/images/grade_black_24dp.png') !important;
491 | }
492 | /* Important */
493 | .aHS-bns .qj {
494 | background-image: url('moz-extension://__MSG_@@extension_id__/images/label_important_black_24dp.png') !important;
495 | }
496 | /* Chats */
497 | .aHS-aHP .qj {
498 | background-image: url('moz-extension://__MSG_@@extension_id__/images/hangout_black_24dp.png') !important;
499 | }
500 | /* Snoozed */
501 | .aHS-bu1 .qj {
502 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic_upcoming_clr_24dp_r5_2x.png') !important;
503 | }
504 | /* Sent */
505 | .aHS-bnu .qj {
506 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic_sent_right_g60_24dp_r1_2x.png') !important;
507 | }
508 | /* Drafts */
509 | .aHS-bnq .qj {
510 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic_draft_g60_24dp_r2_2x.png') !important;
511 | }
512 | /* Trash */
513 | .aHS-bnx .qj {
514 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic_trash_g60_24dp_r2_2x.png') !important;
515 | }
516 | /* Category */
517 | .aHS-bnr .qj {
518 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic_custom-cluster_24px_g60_r3_2x.png') !important;
519 | }
520 | /* Spam */
521 | .aHS-bnv .qj {
522 | background-image: url('moz-extension://__MSG_@@extension_id__/images/ic_spam_g60_24dp_r2_2x.png') !important;
523 | }
524 | }
525 |
526 | .TO.nZ .n0 {
527 | color: #212121 !important;
528 | outline: none;
529 | }
530 | .TO .n0 {
531 | color: #616161 !important;
532 | outline: none;
533 | }
534 |
535 | /* padding for inbox, starred, sent, drafts, snooze */
536 | .TN.bzz.aHS-bnq,
537 | .TN.bzz.aHS-bnu,
538 | .TN.bzz.aHS-bnw,
539 | .TN.bzz.aHS-bnt,
540 | .TN.bzz.aHS-bu1 {
541 | padding-bottom: 5px;
542 | padding-top: 5px;
543 | }
544 |
545 | /* padding for inbox, stared, sent, drafts */
546 | .aim {
547 | margin-left: -14px;
548 | }
549 |
550 | /* left menu border under trash */
551 | .TN.bzz.aHS-bnx {
552 | padding-bottom: 5px;
553 | padding-top: 5px;
554 | border-bottom: 1px solid #DDDDDD;
555 | }
556 |
557 | /*
558 | **
559 | **END OF LEFT MENU
560 | **
561 | */
562 |
563 |
564 | /*
565 | **
566 | **START OF MAIN MENU, SEARCH BAR AND EMAIL AREA
567 | **
568 | */
569 |
570 | /* main top bar including shadow*/
571 | .gb_xd.gb_4d.gb_Fd {
572 | height: 56px;
573 | box-shadow: 0px 5px 4px #c6c6c6;
574 | }
575 |
576 | /* search icon */
577 | button.gb_ff.gb_gf {
578 | margin-top: -3px;
579 | margin-left: 0px;
580 | }
581 |
582 | /* main search window */
583 | .gb_oc.gb_Od.gb_Xd.gb_Td {
584 | margin-left: 10px;
585 | }
586 |
587 | /* search mail text */
588 | input.gb_3e {
589 | margin-top: -5px;
590 | margin-left: 20px;
591 | }
592 |
593 | /* Google Apps icon & Google Account icon */
594 | .gb_w.gb_Xc.gb_f.gb_Af, .gb_Ea.gb_Xc.gb_qg.gb_f.gb_Af {
595 | margin-top: -7px;
596 | }
597 |
598 | /* search bar */
599 | .gb_mf.gb_gf {
600 | margin-top: 0px;
601 | margin-left: 30px;
602 | height: 36px;
603 | }
604 |
605 | /* colapsed main menu */
606 | .no {
607 | background-color: #F2F2F2;
608 | }
609 |
610 |
611 | /* main email area */
612 | .Cp {
613 | margin-top: 2px !important;
614 | }
615 |
616 | /*
617 | **
618 | **END OF MAIN MENU, SEARCH BAR AND EMAIL AREA
619 | **
620 | */
621 |
622 | /* Inbox tabs align center */
623 | .aAA {
624 | max-width: 1200px !important;
625 | }
626 |
627 | .aKk>tbody, .aAA, .aRz.J-KU {
628 | justify-content: center !important;
629 | }
630 |
631 | .J-KU-Jg-K9.aAA > .aRz > .aAy {
632 | justify-content: center;
633 | }
634 |
635 | .aAy > .aKp {
636 | margin-left: 0;
637 | }
638 |
639 | /* behind emails */
640 | .AO, .Tm.aeJ,
641 |
642 | /* left sidebar */
643 | .nH.oy8Mbf.nn.aeN,
644 |
645 | /* right sidebar */
646 | .brC-aT5-aOt-Jw,
647 |
648 | /* Hangout bar */
649 | .aj5 .J-KU, .aj5.J-KU-Jg,
650 |
651 | /* toolbar */
652 | .aeH,
653 |
654 | /* Inbox tabs */
655 | .aKh,
656 |
657 | /* Empty inbox tab */
658 | .aRs
659 | {
660 | background: #F2F2F2 !important;
661 | }
662 |
663 | /* Border under toolbar */
664 | .D.E.G-atb::before {
665 | box-shadow: none;
666 | -webkit-box-shadow: none;
667 | }
668 |
669 | /* top bar (old, new) */
670 | .gb_Ld.gb_je.gb_Td, .nH.w-asV.aiw, .nH.nn {
671 | background-color: #898984;
672 | }
673 | .nH.w-asV.aiw[pageTitle="inbox"],
674 | .nH.w-asV.aiw[pageTitle="inbox"] .nH.nn {
675 | background-color: #4285f4;
676 | }
677 | .nH.w-asV.aiw[pageTitle="snoozed"],
678 | .nH.w-asV.aiw[pageTitle="snoozed"] .nH.nn {
679 | background-color: #ef6c00;
680 | }
681 | .nH.w-asV.aiw[pageTitle="archive"],
682 | .nH.w-asV.aiw[pageTitle="archive"] .nH.nn {
683 | background-color: #0f9d58;
684 | }
685 |
686 | /* Fix background color for vertical split layout */
687 | .UI .nH.nn,
688 | .nH.bkK.nn,
689 | .age {
690 | background-color: unset !important;
691 | }
692 |
693 | /* storage usage, terms of service, privacy, account activity */
694 | .aeG {
695 | display: none;
696 | }
697 |
698 | /* Gmail icon (old, new) */
699 | a[title="Gmail"] {
700 | width: 120px;
701 | overflow: hidden;
702 | text-decoration: none;
703 | }
704 | a[title="Gmail"] img {
705 | display: none;
706 | }
707 |
708 | /* Gmail text */
709 | a[title="Gmail"]::after {
710 | content: 'Search';
711 | font-size: 20px;
712 | color: #FFF;
713 | position: relative;
714 | top: -2px;
715 | padding-left: 7px;
716 | }
717 |
718 | a[title="Gmail"][href="#inbox"]::after {
719 | content: 'Inbox';
720 | }
721 | a[title="Gmail"][href="#snoozed"]::after {
722 | content: 'Snoozed';
723 | }
724 | a[title="Gmail"][href="#archive"]::after {
725 | content: 'Done';
726 | }
727 | a[title="Gmail"][href="#starred"]::after {
728 | content: 'Starred';
729 | }
730 | a[title="Gmail"][href="#sent"]::after {
731 | content: 'Sent';
732 | }
733 | a[title="Gmail"][href="#drafts"]::after {
734 | content: 'Drafts';
735 | }
736 | a[title="Gmail"][href="#imp"]::after {
737 | content: 'Important';
738 | }
739 | a[title="Gmail"][href="#chats"]::after {
740 | content: 'Chats';
741 | }
742 | a[title="Gmail"][href="#scheduled"]::after {
743 | content: 'Scheduled';
744 | }
745 | a[title="Gmail"][href="#all"]::after {
746 | content: 'All Mail';
747 | }
748 | a[title="Gmail"][href="#spam"]::after {
749 | content: 'Spam';
750 | }
751 | a[title="Gmail"][href="#trash"]::after {
752 | content: 'Trash';
753 | }
754 |
755 | /* Invisible inbox info with huge padding at bottom of email */
756 | .pfiaof {
757 | display: none;
758 | }
759 |
760 | /* Top bar icons */
761 | header svg {
762 | color: #FFF !important;
763 | opacity: 1 !important;
764 | }
765 |
766 | /* Search bar (old, new) */
767 | header form {
768 | background: rgba(255, 255, 255, 0.125) !important;
769 | max-width: 90% !important;
770 | }
771 |
772 | /* Search bar icon on active input (old, new) */
773 | .gb_1e.gb_yf.gb_if button svg, .gb_2e.gb_zf.gb_jf button svg {
774 | color: #000 !important;
775 | }
776 | .gb_if {
777 | margin-top: -5px;
778 | }
779 |
780 | /* Search bar placeholder (old, new) */
781 | header form input::placeholder {
782 | color: #FFF !important;
783 | }
784 |
785 | /* Search bar input */
786 | header form input {
787 | color: white !important;
788 | }
789 |
790 | /* Add reminder button */
791 | .add-reminder,
792 | /* Floating compose button */
793 | .floating-compose {
794 | user-select: none;
795 | position: fixed;
796 | z-index: 1000;
797 | border-radius: 50%;
798 | padding: 0;
799 | overflow: hidden;
800 | box-shadow: 0 1px 2px 0 rgba(60,64,67,0.302), 0 1px 3px 1px rgba(60,64,67,0.149);
801 | cursor: pointer;
802 | }
803 |
804 | .add-reminder:hover,
805 | .floating-compose:hover {
806 | box-shadow: 0 1px 3px 0 rgba(60,64,67,0.302), 0 4px 8px 3px rgba(60,64,67,0.149);
807 | }
808 |
809 | /* Add reminder button */
810 | .add-reminder {
811 | right: 48px;
812 | bottom: 90px;
813 | width: 40px;
814 | height: 40px;
815 | background: #4285f4;
816 | }
817 |
818 | /* Add reminder button image */
819 | .add-reminder::before,
820 | /* Compose button image */
821 | .floating-compose::before {
822 | background-size: 24px !important;
823 | background-position: center;
824 | background-repeat: no-repeat;
825 | content: '';
826 | display: block;
827 | }
828 |
829 | /* Add reminder button image */
830 | .add-reminder::before {
831 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/btw_ic_speeddial_reminders_white_24dp_2x.png') !important;
832 | height: 40px;
833 | width: 40px;
834 | }
835 |
836 | /* Floating compose button */
837 | .floating-compose {
838 | right: 40px;
839 | bottom: 20px;
840 | width: 56px;
841 | height: 56px;
842 | background: #d23f31;
843 | }
844 |
845 | /* Compose button image */
846 | .floating-compose::before {
847 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/btw_ic_speeddial_white_24dp_2x.png') !important;
848 | height: 56px;
849 | width: 56px;
850 | }
851 | .floating-compose:hover::before {
852 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/btw_ic_speeddial_compose_white_24dp_2x.png') !important;
853 | }
854 |
855 | /* Hide old compose button */
856 | .T-I.J-J5-Ji.T-I-KE.L3 {
857 | display: none;
858 | }
859 |
860 | /* Archive button (inbox email, opened email) */
861 | .brq, .ar8 {
862 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/btw_ic_done_black_24dp_2x.png') !important;
863 | background-size: 24px !important;
864 | }
865 |
866 | /* Snooze button (inbox email, opened email) */
867 | .brv, .brW {
868 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/btw_ic_snooze_black_24dp_2x.png') !important;
869 | background-size: 24px !important;
870 | }
871 |
872 | @-moz-document url-prefix() {
873 | /* Add reminder button image */
874 | .add-reminder::before {
875 | background-image: url('moz-extension://__MSG_@@extension_id__/images/btw_ic_speeddial_reminders_white_24dp_2x.png') !important
876 | }
877 | /* Compose email image */
878 | .floating-compose::before {
879 | background-image: url('moz-extension://__MSG_@@extension_id__/images/btw_ic_speeddial_white_24dp_2x.png') !important;
880 | }
881 | .floating-compose:hover::before {
882 | background-image: url('moz-extension://__MSG_@@extension_id__/images/btw_ic_speeddial_compose_white_24dp_2x.png') !important;
883 | }
884 | /* Archive button (inbox email, opened email) */
885 | .brq, .ar8 {
886 | background-image: url('moz-extension://__MSG_@@extension_id__/images/btw_ic_done_black_24dp_2x.png') !important;
887 | }
888 | /* Snooze button (inbox email, opened email) */
889 | .brv, .brW {
890 | background-image: url('moz-extension://__MSG_@@extension_id__/images/btw_ic_snooze_black_24dp_2x.png') !important;
891 | }
892 | }
893 |
894 | /* Action buttons on email row */
895 | .bqX {
896 | margin: 0 10px !important;
897 | }
898 |
899 | /* Done button on email row */
900 | .bqX.brq {
901 | order: 3;
902 | margin-right: 22px !important;
903 | }
904 |
905 | /* Delete button on email row */
906 | .bqX.bru {
907 | order: 2;
908 | }
909 |
910 | /* Opened email */
911 | .Bs.nH.iY.bAt {
912 | margin: 10px;
913 | box-shadow: 0 -1px 0 #e0e0e0, 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.24) !important;
914 | width: calc(100% - 62px);
915 | background: #FFF;
916 | }
917 |
918 | /* Fixed border on email */
919 | .Bu > .nH > .no {
920 | display: none;
921 | }
922 |
923 | /* Left toolbar when collapsed (this is done to fix hidden compose button when collapsed) */
924 | .bhZ {
925 | position: relative !important;
926 | margin-right: -72px;
927 | }
928 |
929 | /* Attachments styling to look more like inbox */
930 | .brd {
931 | margin-left: 0px !important;
932 | }
933 | .brc {
934 | border-radius: 2px !important;
935 | background-color: #f7f7f7;
936 | padding: 0 6px !important;
937 | color: #212121 !important;
938 | box-shadow: 0 0 1px rgba(0,0,0,.11), 0 1px 2px rgba(0,0,0,.22) !important;
939 | }
940 | .brc .brg {
941 | font-size: 13px !important;
942 | }
943 |
944 | /* --------------------------------------------- */
945 | /* Hides the pin icon until the mouse is over it */
946 | /* --------------------------------------------- */
947 |
948 | /* Nudges the pin along and then moves the date/time over a bit */
949 | .zA .apU.xY {
950 | margin-right: 2px;
951 | }
952 | .zA .xW.xY {
953 | margin-left: -32px;
954 | margin-right: 10px;
955 | }
956 |
957 | /* Handles the positioning of the quick action icons that appear when you mouse over an email row to make room for the pin */
958 | .bqY {
959 | position: relative;
960 | left: -10px;
961 | }
962 |
963 | /* Hides the pin when not pinned, until the cursor is over it */
964 | .zA .apU.xY .aXw {
965 | display: none;
966 | }
967 | .zA .apU.xY .T-KT-JW {
968 | display: flex;
969 | }
970 | .aqw .apU.xY .aXw {
971 | display: flex;
972 | }
973 |
974 | /* --------------------------------------------- */
975 | /* Inbox and top toolbar layout */
976 | /* --------------------------------------------- */
977 |
978 | /* Inbox: message list layout */
979 | .nH .AO .aeF {
980 | min-width: 512px;
981 | margin-right: 7vw;
982 | width: auto;
983 | }
984 |
985 | /* Inbox: starred heading space */
986 | .Cp {
987 | margin: 0 5px;
988 | }
989 |
990 | /* Inbox: hide the starred heading */
991 | .nH.Wg.aAD.aAr {
992 | display: none;
993 | }
994 |
995 | /* Inbox: hide the everything else heading */
996 | .nH.Wg.aAr {
997 | display: none;
998 | }
999 |
1000 | /* Inbox: date groupings */
1001 | .time {
1002 | font-size: 13px;
1003 | padding-top: 13px;
1004 | }
1005 |
1006 | /* Inbox: email rows */
1007 | .zA {
1008 | padding: 13px 12px 13px 10px !important;
1009 | }
1010 |
1011 | /* Email selected with keyboard shortcut (remove left padding so blue bar is still right against the left edge) */
1012 | .zA.btb {
1013 | padding-left: 5px !important;
1014 | }
1015 | .zA.btb .PF.xY.PE {
1016 | margin-right: 10px;
1017 | }
1018 |
1019 | /* Inbox: email row contents */
1020 | .zA * {
1021 | font-size: 13px;
1022 | }
1023 |
1024 | /* Moves the selection indicator to the left */
1025 | .PF.xY.PE {
1026 | margin-left: -5px;
1027 | margin-right: 5px;
1028 | }
1029 |
1030 | /* Hides the checkbox when not checked */
1031 | .show-avatar-enabled .zA .oZ-x3.xY .T-Jo {
1032 | display: none;
1033 | }
1034 |
1035 | .zA .oZ-jc.T-Jo.J-J5-Ji {
1036 | margin-left: -4px;
1037 | }
1038 |
1039 | /* hide the drag icon next to checkbox */
1040 | .aqw>td.oZ-x3:before {
1041 | display: none;
1042 | }
1043 |
1044 | /* Unhides the checkbox when checked */
1045 | .zA.aqw .oZ-x3.xY .T-Jo {
1046 | display: inline;
1047 | }
1048 | .aqw .yX.xY div:nth-child(n+3)>img {
1049 | display: none;
1050 | }
1051 | .x7 .yX.xY div:nth-child(n+3)>img {
1052 | display: none;
1053 | }
1054 | .zA.x7 .oZ-x3.xY .T-Jo {
1055 | display: inline;
1056 | }
1057 |
1058 | /* */
1059 | /* Rearranges the menu at the top and moves it all to the right corner */
1060 | /* */
1061 |
1062 | /* the bar that the menu items typically rest on */
1063 | .G-atb {
1064 | height: 48px;
1065 | }
1066 |
1067 | /* shifts the inbox down */
1068 | .aeF {
1069 | margin-top: -8px;
1070 | }
1071 |
1072 | .nH.aqK {
1073 | padding-top: 0px;
1074 | }
1075 |
1076 | .Cq.aqL {
1077 | margin-left: auto;
1078 | margin-right: -24px;
1079 | }
1080 |
1081 | .Cr.aqJ {
1082 | margin-left: 0px;
1083 | margin-right: 0px;
1084 | }
1085 |
1086 | /* Snoozed notification styling */
1087 | .cL {
1088 | font-weight: normal !important;
1089 | font-size: 13px;
1090 | margin-left: 0px !important;
1091 | }
1092 |
1093 | /* --------------------------------------------- */
1094 | /* Calendar event as attachment */
1095 | /* --------------------------------------------- */
1096 |
1097 | .calendar-attachment {
1098 | height: 80px !important;
1099 | width: 400px !important;
1100 | }
1101 |
1102 | .calendar-attachment .brc {
1103 | height: 80px;
1104 | width: 400px;
1105 | max-width: 400px !important;
1106 | padding-left: 0 !important;
1107 | }
1108 |
1109 | .calendar-attachment .brg {
1110 | display: flex;
1111 | flex-direction: column;
1112 | max-width: 250px;
1113 | overflow: visible;
1114 | }
1115 |
1116 | .calendar-attachment .event-title, .calendar-attachment .event-time {
1117 | overflow: hidden;
1118 | text-overflow: ellipsis;
1119 | white-space: nowrap;
1120 | }
1121 | .calendar-attachment .event-title {
1122 | font-weight: normal;
1123 | }
1124 | .calendar-attachment .event-time {
1125 | color: #757575;
1126 | }
1127 |
1128 | .calendar-attachment .aKS {
1129 | position: relative;
1130 | top: 0;
1131 | margin-top: 4px;
1132 | }
1133 |
1134 | .calendar-attachment .aKS .aOd.T-I-awv {
1135 | border-radius: 2px;
1136 | }
1137 |
1138 | .calendar-image {
1139 | height: 80px;
1140 | width: 100px;
1141 | background-position: center;
1142 | background-image: url('chrome-extension://__MSG_@@extension_id__/images/calendar_event_attachment.png') !important;
1143 | background-size: 200%;
1144 | margin-right: 16px;
1145 | }
1146 | @-moz-document url-prefix() {
1147 | .calendar-image {
1148 | background-image: url('moz-extension://__MSG_@@extension_id__/images/calendar_event_attachment.png') !important;
1149 | }
1150 | }
1151 |
1152 | /* Remove gmail calendar icon */
1153 | .yf img.xL {
1154 | display: none;
1155 | }
1156 |
1157 | /* Labels inline in email list */
1158 | .ar {
1159 | height: 22px !important;
1160 | border-radius: 2px !important;
1161 | }
1162 |
1163 | .ar .av {
1164 | padding-top: 2px;
1165 | }
1166 |
1167 | /* Name avatar */
1168 | .avatar {
1169 | background: url('chrome-extension://__MSG_@@extension_id__/images/ic_reminder_blue_24dp_r2_2x.png');
1170 | color: rgba(255, 255, 255, 0.65);
1171 | border-radius: 50%;
1172 | font-size: 18px;
1173 | font-family: 'Roboto', sans-serif;
1174 | font-weight: 400;
1175 | position: relative;
1176 | left: -6px;
1177 | flex: 32px 0 0;
1178 | width: 32px;
1179 | height: 32px;
1180 | text-align: center;
1181 | line-height: 32px;
1182 | background-size: 75% 75% !important;
1183 | background-repeat: no-repeat !important;
1184 | background-position: center !important;
1185 | }
1186 | @-moz-document url-prefix() {
1187 | .avatar {
1188 | background: url('moz-extension://__MSG_@@extension_id__/images/ic_reminder_blue_24dp_r2_2x.png');
1189 | }
1190 | }
1191 |
1192 | .zA:hover .avatar {
1193 | display: none;
1194 | }
1195 |
1196 | .zA > .oZ-x3 > div[aria-checked="true"] + .avatar {
1197 | display: none;
1198 | }
1199 |
1200 | /* Alignment of calendar icon */
1201 | .zA>.yf {
1202 | padding-right: 32px !important;
1203 | }
1204 |
1205 | /* Hide important indicator on reminders */
1206 | .reminder .WA.xY {
1207 | visibility: hidden;
1208 | }
1209 |
1210 | /* Right side Hangouts */
1211 | div[aria-label="Hangouts"][role="complementary"] {
1212 | background-color: rgb(242, 242, 242) !important;
1213 | }
1214 |
1215 | .nH.bkK.nn + .nH.nn {
1216 | background-color: #e5e5e5 !important;
1217 | }
1218 |
1219 | /* Subject padding in opened email */
1220 | .if > .byY, .iC .byY {
1221 | padding: 20px 4px 8px 20px !important;
1222 | }
1223 |
1224 | /* Subject padding in email list */
1225 | .zA > .yX {
1226 | padding: 0 15px !important;
1227 | }
1228 |
1229 | /* Align the checkbox with first letter avatar */
1230 | .zA .oZ-jc.T-Jo.J-J5-Ji {
1231 | margin-left: 1px;
1232 | }
1233 |
1234 | /* Hide the drag icon next to checkbox */
1235 | .aqw > td.oZ-x3:before {
1236 | display: none;
1237 | }
1238 |
1239 | /* Hide labels next to email subject */
1240 | .nH > .ha > .J-J5-Ji {
1241 | display: none;
1242 | }
1243 |
1244 | /* Hide buttons next to email subject */
1245 | .nH > .nH > .hj > .ade {
1246 | display: none;
1247 | }
1248 |
1249 | /* Hide full length email address */
1250 | .iw > .qu > .go {
1251 | display: none;
1252 | }
1253 |
1254 | /* Spacing on bottom of email list */
1255 | .BltHke.oy8Mbf {
1256 | margin-bottom: 40px;
1257 | }
1258 |
1259 | .bundle-image {
1260 | margin-left: 13px;
1261 | }
1262 | .bundle-image img {
1263 | width: 28px;
1264 | }
1265 |
1266 | .bundle-wrapper .label-link {
1267 | margin-left: 5px;
1268 | font-size: 13px;
1269 | margin-right: 32px;
1270 | }
1271 | .bundle-wrapper.contains-unread .label-link,
1272 | .bundle-wrapper .bundle-senders span.strong {
1273 | font-weight: 700;
1274 | }
1275 | .bundle-wrapper:not(.contains-unread) .bundle-image img {
1276 | opacity: 0.6;
1277 | }
1278 |
1279 | .bundle-senders {
1280 | color: #202124 !important;
1281 | }
1282 | /* Parent of .bundle-senders */
1283 | .label-link + .xW.xY {
1284 | flex-grow: 1;
1285 | overflow: hidden;
1286 | }
1287 |
1288 | .bundle-wrapper .label-link .bundle-count {
1289 | font-weight: 400;
1290 | margin-left: 5px;
1291 | color: gray;
1292 | }
1293 |
1294 | /* Colored bundle titles for Inbox categories */
1295 | .zA.yO[bundleLabel="Updates"] .label-link > span:not(.bundle-count) {
1296 | color: rgb(255, 104, 57);
1297 | }
1298 | .zA.yO[bundleLabel="Promotions"] .label-link > span:not(.bundle-count) {
1299 | color: rgb(0, 188, 212);
1300 | }
1301 | .zA.yO[bundleLabel="Forums"] .label-link > span:not(.bundle-count) {
1302 | color: rgb(63, 81, 181);
1303 | }
1304 | .zA.yO[bundleLabel="Social"] .label-link > span:not(.bundle-count) {
1305 | color: rgb(219, 68, 55);
1306 | }
1307 | .zA.yO[bundleLabel="Travel"] .label-link > span:not(.bundle-count),
1308 | .zA.yO[bundleLabel="Trips"] .label-link > span:not(.bundle-count) {
1309 | color: rgb(156, 39, 176);
1310 | }
1311 | .zA.yO[bundleLabel="Finance"] .label-link > span:not(.bundle-count) {
1312 | color: rgb(103, 159, 56);
1313 | }
1314 | .zA.yO[bundleLabel="Orders"] .label-link > span:not(.bundle-count),
1315 | .zA.yO[bundleLabel="Purchases"] .label-link > span:not(.bundle-count) {
1316 | color: rgb(121, 85, 72);
1317 | }
1318 |
1319 | .bundled-email {
1320 | display: none !important;
1321 | }
1322 |
1323 | /* Bundle row settings */
1324 | .zA > span.oZ-x3 {
1325 | order: 0;
1326 | }
1327 |
1328 | .hide-important-markers {
1329 | display: none !important;
1330 | }
1331 |
1332 | /* Hide labels on emails when bundling is enabled */
1333 | body.email-bundling-enabled .bundled-email .yi,
1334 | body.email-bundling-enabled.bundle-page .nH.ar4.B .yi {
1335 | display: none !important;
1336 | }
1337 |
1338 | /* Override narrow width class */
1339 | .Zs .zA {
1340 | -webkit-flex-wrap: nowrap !important;
1341 | flex-wrap: nowrap !important;
1342 | }
1343 | .Zs .zA > .a4W {
1344 | margin-left: unset !important;
1345 | }
1346 | .Zs .a4W .xT {
1347 | flex-wrap: unset !important;
1348 | }
1349 | .Zs .yi {
1350 | margin-left: 0 !important;
1351 | max-width: unset !important;
1352 | }
1353 | .Zs .y2 {
1354 | min-width: unset !important;
1355 | -webkit-flex: 1 !important;
1356 | flex: 1 !important;
1357 | }
1358 | .Zs .zA > .xW {
1359 | -webkit-flex-basis: 1 !important;
1360 | flex-basis: 1 !important;
1361 | flex-grow: 400 !important;
1362 | flex-basis: 0 !important;
1363 | }
1364 | .Zs .y6 {
1365 | order: 1 !important;
1366 | }
1367 | .Zs .zA > .yX {
1368 | flex: initial !important;
1369 | }
1370 | .Zs .zA > .xY {
1371 | order: 1 !important;
1372 | }
1373 |
1374 |
1375 | /* Hide Compose and Reminder buttons from Gmail's Print view */
1376 | @media print {
1377 | .add-reminder,
1378 | .floating-compose {
1379 | display: none;
1380 | }
1381 | }
1382 |
--------------------------------------------------------------------------------