r/web_design • u/bogdanelcs • Nov 18 '22
Stylify: Write CSS faster
https://stylifycss.com/2
u/1116574 Nov 18 '22
I don't get it. You are writing your styles in classes? And use some shorthand like from scss or sass whatever?
It's something between using style= in html and tailwind?
1
u/Machy8 Nov 18 '22
Hi! Stylify is an alternative to Tailwind. It works differently and has CSS-like selectors. It has nothing to do with style attribute. The reason why it looks like CSS is to remove the need to study shortcuts to style the web.
2
u/everything_in_sync Nov 18 '22
I don't see how this is useful at all. "Don't learn another framework! Learn Stylify! A CSS framework with nonsensical extra steps!
0
u/Machy8 Nov 18 '22
Hi, please can you explain what do you see as nonsencial extra steps?
2
u/everything_in_sync Nov 18 '22
What is the difference between this and inline styling?
<span class=" font-size:32px lg:font-size:48px color:#fff border-bottom:4px\\_solid\\_transparent transition:border-color\\_0.3s hover:border-color:#bd0c65 "> Edit me 🤩! </span>
<span style=" font-size: 32px; color: #fff; border-bottom: 4px solid transparent; transition: border-color .3s;"> Edit me </span>
Sure you can't change hover state inline but we're already so deep in nonsense because you should just be writing css in a separate file anyway.
2
u/Machy8 Nov 18 '22
Inline styles are not responsive neither optimizable =>
Cannot be split to css chunks
Selectors cannot be mangled
It causes duplicate property values
Has higher selector specificity
Harder to change in javascript
Cannot merge component to utility selector
Etc => https://stylifycss.com/faq
"You should just be writting css in separate file"
Is just an approach that doesn't have to be followed and causes CSS size to be unnecessary large.1
u/everything_in_sync Nov 18 '22
I'm pretty sure vanilla css has been doing fine for the past 30 years.
2
u/Machy8 Nov 18 '22
I am not saying anything against Vanilla CSS. Stylify is there because writting manually components, where each required property is attached to a utility to make the CSS smaller, then mangle selectors, is simply enormously time spending and slow. We can use Purge CSS to clean unused CSS but it is a step, that should not even be in the project. It just cleans the mess that should not be in the project at all.
I can hardly imagine the time spend on writing something like bellow manually in pure CSS.
HTML
<span class="label"> Components time!<span class="label-icon">🎉</span> </span>Mangled - HTML
<span class="h"> Components time!<span class="g">🎉</span> </span>Production css
.g, .i{margin-left: 8px} .h,.j{display: flex} .h,.k{line-height: 1.2} .h,.c{font-size: 32px} .h,.l{align-items: center} @media (min-width: 1024px) { .g,.a{font-size: 48px} }1
u/everything_in_sync Nov 18 '22
What are the I,j,k,c,l,a doing?
This is just me personally but I would lose my mind if my html file looked like this:
<button class="display:inline-flex align-items:center padding:12px_24px border-radius:24px white-space:nowrap line-height:24px border:none font-weight:700 letter-spacing:0.1px outline:none cursor:pointer line-height:20px font-size:16px color:#fff user-select:none text-decoration:none background:$primaryColor transition:background_0.3s hover:background:lighten($primaryColor,20) focus:background:lighten($primaryColor,20)">Button</button>That's an example off of your website on styling a single button.
2
u/Machy8 Nov 18 '22
Stylify mangles long selectors like
font-size:24pxto shorta,b,c. You can move these long selectors to components. Then you can usebuttonclass selector =><button class="button"></button>.That is the example right under the first example.
2
2
u/ChiBeerGuy Nov 18 '22
Terrible idea. Stylesheets should cascade. This looks like the son of tailwind.