Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Hint color names in CSS Code Hints #10410

Merged
merged 2 commits into from
Jan 21, 2015
Merged

Conversation

marcelgerber
Copy link
Contributor

Shows color names in Code Hints for CSS properties like color, background-color, border-left-color, ...

image

@le717
Copy link
Contributor

le717 commented Jan 18, 2015

Unless I'm missing something, you've completely removed currentColor. currentColor is a valid "color" with special meaning, and a standardized CSS3 spec.

@marcelgerber
Copy link
Contributor Author

Oh, I didn't know this was a valid value.
Will add it back tomorrow.

@marcelgerber
Copy link
Contributor Author

@le717 Done.

@redmunds
Copy link
Contributor

@marcelgerber Very cool! Merging.

@sprintr This same technique can be used to add named colors back into SVG code hints.

redmunds added a commit that referenced this pull request Jan 21, 2015
@redmunds redmunds merged commit c32fa5f into adobe:master Jan 21, 2015
@le717
Copy link
Contributor

le717 commented Jan 21, 2015

@marcelgerber @redmunds Thanks for merging this! :D This has always been a curious missing feature for me, considering the built-in color editor

@marcelgerber
Copy link
Contributor Author

Thanks for merging :)
We can possibly add a "color preview bagde" later on (a badge on the right of the hints popup), but I need to have a look at the code before.
Can a hint provider combine jQuery & rawtext hints?

@RaymondLim
Copy link
Contributor

@marcelgerber Yes, you can combine raw text hints with jQuery as in the following example I used in my "user key map hints" (not in the repo yet).
keymaphints

code snippet in getHints that appends the assigned key to raw text command id.

            result = $.map(this._allCommands, function (value, key) {
                if (value.toLowerCase().indexOf(query.toLowerCase()) === 0) {
                    if (self.keyMap[value]) {
                        return value + "&nbsp;<span class='display-key'>" + self.keyMap[value] + "</span>";
                    } else {
                        return value;
                    }
                }
            }).sort();

code snippet in insertHint that extracts command id by excluding the appended key.

        if (hint.indexOf("&nbsp;") !== -1) {
            hint = hint.slice(0, hint.indexOf("&nbsp;"));
        }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants