Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $hintSelector variable #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If you are already using v1.x, you may need to tweak certain position classes be

Don't like BEM naming (`hint--`) or want to use your own prefix for the class names?

Simply update `src/hint-variables.scss` and change the `$hintPrefix` variable.
Simply customize via the `$hintSelector` and `$hintPrefix` variables defined in [src/hint-variables.scss](src/hint-variables.scss)
To generate the css file, please read the [contributing page](./CONTRIBUTING.md).

## Who's Using This?
Expand Down
2 changes: 1 addition & 1 deletion src/hint-core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* 1) hint
*/

[class*="#{$hintPrefix}"] {
#{$hintSelector} {
position: relative;
display: inline-block;

Expand Down
4 changes: 2 additions & 2 deletions src/hint-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*
*/

[class*="#{$hintPrefix}"] {
#{$hintSelector} {
/**
* tooltip body
*/
&:after {
text-shadow: 0 -1px 0px darken($hintDefaultColor, $hintTextShadowDarkenAmount);
box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
}
}
}
3 changes: 3 additions & 0 deletions src/hint-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// Prefix for all classes. By default, BEM naming convention is used
$hintPrefix: 'hint--' !default;

// Selector applying to all hints
$hintSelector: '[class*="#{$hintPrefix}"]' !default;

// font size
$hintFontSize: 12px !default;

Expand Down