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

basicShorthandReplace is not defined #5

Open
jsrothwell opened this issue Oct 6, 2015 · 5 comments
Open

basicShorthandReplace is not defined #5

jsrothwell opened this issue Oct 6, 2015 · 5 comments

Comments

@jsrothwell
Copy link

Ive been getting basicShorthandReplace is not defined whenever I try to do the following example CSS

padding-right:10px;
padding-left:5px;
padding-top:10px;
padding-bottom:10px;

Im getting the same error if I try margins. I haven't tried any features similar yet. I can work around it easily by doing something like

padding:10px;
padding-left:5px;

which is better CSS but I thought Id bring up the error in question.

@kudinovfedor
Copy link

I looked at the code and found next solution. To fix this problem you need to do the following:

Open the file that is located in your project folder in the following path:
node_modules\shrthnd\lib\shorthanders\margin-padding.js

Line 19 return basic Shorthand Replace (shorthand, declarations);

It needs to be commented out just put in front of her two slashes:
// return basicShorthandReplace(shorthand, declarations);

Then add this line of code and save:
return declarations[propertyName + '-top'].value + ' ' + declarations[propertyName + '-right'].value + ' ' + declarations[propertyName + '-bottom'].value + ' ' + declarations[propertyName + '-left'].value;

padding-top: 10px;
padding-bottom: 8px;
padding-left: 5px;
padding-right: 3px;

margin-top: 10px;
margin-bottom: 8px;
margin-left: 5px;
margin-right: 3px;

Upon completion of the task the code will be the following
padding: 10px 3px 8px 5px;
margin: 10px 3px 8px 5px;

@frankmarineau
Copy link
Owner

Thanks for the feedback both of you! I haven't been able to spend some time on this for a while, but I'll be looking over issues / PRs this weekend. I'll get back to you when it's done. @kudinovfedor if you feel like tackling this yourself before I do this weekend, go ahead!

@mrtoxas
Copy link

mrtoxas commented Apr 2, 2017

Same error

@hozakjaf
Copy link

hozakjaf commented Jul 2, 2018

Hi Maybe late on this one. I changed the code in node_modules\shrthnd\lib\shorthanders\margin-padding.js and this works great. Thanks!

Can you update the package so that this is the standard?

@Chicot73
Copy link

Chicot73 commented Feb 8, 2025

Thanks!!!! It is working in 2025!!!!!!!!!!!!!!!

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

No branches or pull requests

6 participants