-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Default theme will be loaded regardless of theme.config #736
Comments
@Yahav Thank you for the feedback Indeed the You can directly try the change by replacing 3 files: https://raw.githubusercontent.com/fomantic/Fomantic-UI/bf65cdee45a98a8e3040940eca13b34aa68647a3/src/definitions/elements/button.less Would love if you give FUI a second chance again 😉 |
Hey,that is not respectful way to communicate with people. |
You know what, you're quite right, imagine my high spirit when i found out SUI got a properly maintained fork, now imagine the heart break when i realized i won't be able to use it due to this. @lubber-de Thank you very much, i'll have another look at it, i only hope it would work. |
@lubber-de |
@Yahav From what i understood and what i was able to reproduce :
Of course, you have to make sure, that (now only in your copied If it seems to completely ignoring your whole |
@lubber-de it still produces such errors: |
@Yahav It seems LESS tries to immediatly recalculate As you are replacing the variables by something LESS cannot work with (using functions), i think there are only 2 options (didn't test): 1. Change order of variable definitionsLESS sees the current import order and tries to compile line by line immediatly: //themes/default/globals/site.variables
@linkColor : #4183C4;
@linkHoverColor : darken(saturate(@linkColor, 20), 15, relative); //works
//themes/site/globals/site.variables
@linkColor : var(--accent-link-color); // As @linkHoverColor is already defined at this time, less tries to recalculate it with the new @linkColor and breaks
@linkHoverColor : var(--accent-link-hover-color); Try to change the definition order to //themes/default/globals/site.variables
@linkColor : #4183C4;
@linkHoverColor : darken(saturate(@linkColor, 20), 15, relative); //works
//themes/site/globals/site.variables
@linkHoverColor : var(--accent-link-hover-color); //should work fine, because nowhere used for further calculation
@linkColor : var(--accent-link-color); // should hopefully also work now, because , due to replacement of @linkHoverColor, it is not used anywhere else anymore
The same logic should be applied for every Try this order in your themes/site/globals/site.variables @primaryColorHover : var(--accent-hover-color);
@lightPrimaryColorHover : var(--light-accent-hover-color);
@primaryColorFocus : var(--accent-focus-color);
@lightPrimaryColorFocus : var(--light-accent-focus-color);
@primaryColorDown : var(--accent-color-darkened-10);
@lightPrimaryColorDown : var(--light-accent-hover-color-darkened-10);
@primaryColorActive : var(--accent-color-active);
@lightPrimaryColorActive : var(--light-accent-color-active);
@primaryHeaderColor : var(--accent-header-color);
@primaryRibbonShadow: var(--accent-color-darkened-10);
@primaryInvertedRibbonShadow: var(--light-accent-color-darkened-10);
@primaryColor : var(--accent-color);
@lightPrimaryColor : var(--light-accent-color);
@primaryBackground : var(--accent-bg-color);
@primaryTextColor : var(--accent-text-color);
@lightPrimaryTextColor : var(--accent-light-text-color);
2. Make all your changes directly in the default site folder insteadIf the above does not help, i fear the only solution will be to only use the default theme |
@lubber-de |
also, even when i override the default file, i still get this error: |
@Yahav Do you get the exact same error at the same file/line? Or is it different now (and did you implement those 3 files from my PR Fix ? Then there are additional
Definately! But unfortunately the demand of keeping IE11 supported is too high atm, and CSS variables as well as pure ES6 is not supported by IE11 (and CSS variables cannot even get a reasonable polyfill) |
Well, then my solution proposal seems to work! You only have to add the new tertiary variables from my PR to your site.variables accordingly! 😄 |
and you have to adjust your |
Same lines..or was i doing something wrong? hehe at some point it was getting pretty confusing.
already applied your PR, check this: https://github.com/Yahav/fomanticUiColorSystem/commits/master |
Was missing those at the colors.less of the custom theme i created, once added it went ahead to the next error: |
@Yahav I checked your code: As said, you have to apply the additional properties from I would simply copy the file 😉 or leave it out/delete it, as long as the content is identical to the default one. |
@lubber-de yeah, i figured it out, jesus this is quite confusing. anyway, check my previous message |
@lubber-de What's wrong with ponyfill? |
Oh 👀 never came across this.
Yes, of course and this is planned for v3. But again, it's just IE11 which forces us to code in ES6, but provide ES5 (and its up to babel to make sure everything works as intended when coding in ES6) But this is a separate discussion for V3, which we could continue in this thread instead |
@lubber-de the order approach doesn't work (if i tried it correctly), i'm afraid the solution would be overwriting the default theme :( |
The problem in this case is, that the elements default variables are imported in any case right after the site.variables, so //order of import
default/site.variables //(less functions)
custom/site.variables //(var(--) in "good" order
default/element.variables // it breaks, if here are again less functions refering to `var(--)` variables used😢
custom/element.variables // (var(--) in "good" order ....but too late Yes, i am afraid, at least for the default themes |
@lubber-de
part as well, had to rewrite the entire default/site.variables. |
We fixed the default variable dependency issue now by #2857 |
Help Wanted
What i'm trying to do is have the FUI primary color be bounded to a css var(), the main issue is the usage of pre-processing functions.
So what i did is to copy the site.variables of the default them and copied it to
/site/globals/site.variables
and modified every primary related var to a css var(), like this:@linkColor : var(--accent-link-color); @primaryBackground : var(--accent-bg-color);
I then went ahead and tried to compile and got the following:
{ [Error: error evaluating function
darken: color.toHSL is not a function in file /home/yahav/fomantic_themeColors/semantic/src/themes/default/globals/site.variables line no. 145] message: 'error evaluating function
darken: color.toHSL is not a function in file /home/yahav/fomantic_themeColors/semantic/src/themes/default/globals/site.variables line no. 145', stack: undefined, type: 'Runtime', filename: '/home/yahav/fomantic_themeColors/semantic/src/themes/default/globals/site.variables', index: 3383, line: 145, column: 23, callLine: NaN, callExtract: undefined, extract: [ '@linkUnderline : none;', '@linkHoverColor : darken(saturate(@linkColor, 20), 15, relative);', '@linkHoverUnderline : @linkUnderline;' ], lineNumber: 145, fileName: '/home/yahav/fomantic_themeColors/semantic/src/themes/default/globals/site.variables', name: 'Error', plugin: 'gulp-less', showProperties: true, showStack: false, __safety: { toString: [Function: bound ] } }
so i created a new theme folder, basically copied the default theme and renamed it, i then copied the
/site/globals/site.variables
file to this new theme's site.variables and changed every occurrence of 'default' at theme.config to the new theme's name.and yet, i still get the same error which means FUI is trying to compile the
themes/default/globals/site.variables
file although i have defined the new theme AND have asite/globals/site.variables
file overriding it a well.I can simply overwrite the default theme site.variables and it will work (i had this same setup when i was using SUI) but it won't be wise.
Any ideas?
The text was updated successfully, but these errors were encountered: