Consider using Attribute Modules instead of classes
Using Attribute Modules (spec) might be an even more semantic way of specifying styles. It would solve all of the naming conflicts we've encountered, particularly with positioning classes like top, left, etc.
The module naming pattern could be ui-* or perhaps sui-*
I personally think this makes the code ugly and unwieldy. The simplicty and elegance of "large icon button" versus "ui-btn-large icon-btn" is one of the biggest reasons I enjoy working with Semantic in the first place.
You clearly didn't read the link. They suggest:
<button ui-Button="large icon">Click me</button>
<div ui-Grid="3">
<div ui-column="1/3">First Column</div>
<div ui-column="2/3">Second Column</div>
</div>
You haven't understood my point. I don't want to have to use ui-Button, ui-Menu, ui-* over the simple elegance of storing everything in the class attribute. I think it would introduce clunky code like
<div class="ui form segment" ui-Form="small" ui-Segment="top attached">
I like that a lot less than <div class="ui small form top attached segment">.
A strategy like this might make sense, but would require time to become consensus. I appreciate techniques like this, but I don't believe its SUI's duty to prescribe new development standards, but instead to only provide conventions around existing well-adopted standards.
@Knotix That's a really nice idea, actually! @jlukic Don't you think we can use this technique for #626 ? I am actually in dire need of visibility classes right now as well, and I've actually tried to port the existing codebase from the Foundation framework. But, looks like there seems to be no way of actually adhering to Semantic's naming conventions if I want to make this work. In foundation, we have classes like small-2 large-4 columns, but then, to implement it in Semantic, it would become more like small.two.large.four.columns in which case it might not work with the current CSS unless we think of something clever. And this is where I think @Knotix 's idea makes sense, don't you think?
@dsignr jwarnes is against the idea. Are you sure you don't have your names mixed up?
This would be confusing with something like angular where that looks like an attribute directive, and completely incompatible with react which doesn't have a mechanism for setting arbitrary made-up attributes. If this becomes part of an official spec, then it'd definitely be worth considering.
I understand the reasoning, and there's a problem with the class naming collisions in SUI, but I don't think this is the right solution.
Semantic doesn't allow you to specify column widths for multiple screen sizes. My belief is that, if either doubling or stackable doesnt solve your issues, Then you should use custom fixed container sizes for your responsive breakpoints.
I think the important thing to remember when using frameworks like SUI is that although it solves for a lot of generic issues that fit for most sites there will always be something unique about any individual project you are facing, and that its okay in those instances to rely on standard css. In many cases the necessary breakpoints for responsive content doesn't conveniently run in line with device breakpoints, so you have to be able to toss in custom responsive code when you need it as well.
On personal projects I use three separate stylesheets, mobile, tablet and computer.css where I manually adjust sizes and hide elements for each screen size, and sometimes use individual breakpoints for when content no longer fits somewhere in-between device breakpoints.
I agree with @jlukic in that semantic or any other framework cannot and should not resolve many or every edge case issue.
A place to collect examples of how to solve edge cases like thirds might be more productive.
@Knotix Right, I mixed up the names..sorry! :dancer:
@jwarnes But that means a whole bunch of ambiguity.
<div class="ui small form top attached segment">
Is "small" referring to "form" or might "small" be referring to "segment"? Unless I learn the framework first, I have no idea when I approach the project.
@wriver4 Excellent perspective!
This is a topic with a lot of academic history outside of the scope of web-dev. The premise of the library is that the principles of compositionality are correct, and that meaning in language can be broken up into a formal system of rules.
It's definitely possible to construct cases where these systems for determining meaning may be difficult, for example see the many "unicorn" examples, but this does not prevent it's immediate usefulness.
Language permits a certain type of permissible vagueness, just like shouting "There's three angry tigers coming to maul us" perhaps omits the breed or gender of the tigers but still conveys plenty of useful meaning.
I generally have a hard time bridging the gap on these issues because most people aren't willing to accept the premise that natural languages and computer languages are similar formal systems of logic. I think its part of the same issue that bothers people about substance dualism.
Either way, I'm certain that none of this is a convincing argument for a web developer, of our generation, so I generally prefer an orthogonal axis of argumentation for SUI, its "usefulness", its "maintainability" etc.
I agree with the premise and I greatly appreciate this library. Thank you again and again. :)